| 1 | .\" Copyright (c) 1980 Regents of the University of California. |
| 2 | .\" All rights reserved. |
| 3 | .\" |
| 4 | .\" %sccs.include.proprietary.roff% |
| 5 | .\" |
| 6 | .\" @(#)sa.8 6.4 (Berkeley) %G% |
| 7 | .\" |
| 8 | .TH SA 8 "" |
| 9 | .UC 4 |
| 10 | .SH NAME |
| 11 | sa, accton \- system accounting |
| 12 | .SH SYNOPSIS |
| 13 | .B sa |
| 14 | [ |
| 15 | .B \-abcdDfijkKlnrstuv |
| 16 | ] [ |
| 17 | .B \-S |
| 18 | savacctfile ] [ |
| 19 | .B \-U |
| 20 | usracctfile ] [ file ] |
| 21 | .PP |
| 22 | .B accton |
| 23 | [ file ] |
| 24 | .SH DESCRIPTION |
| 25 | With an argument naming an existing |
| 26 | .I file, |
| 27 | .I accton |
| 28 | causes system accounting information for |
| 29 | every process executed to be placed at the end of the file. |
| 30 | If no argument is given, accounting is turned off. |
| 31 | .PP |
| 32 | .I Sa |
| 33 | reports on, cleans up, and generally maintains accounting files. |
| 34 | .PP |
| 35 | .I Sa |
| 36 | is able to condense the information in |
| 37 | .I /var/account/acct |
| 38 | into a summary file |
| 39 | .I /var/account/savacct |
| 40 | which contains a count of the |
| 41 | number of times each command was called and the time resources consumed. |
| 42 | This condensation is desirable because on a large system |
| 43 | .I /var/account/acct |
| 44 | can grow by 100 blocks per day. |
| 45 | The summary file is normally read before the accounting file, |
| 46 | so the reports include all available information. |
| 47 | .PP |
| 48 | If a file name is given as the last argument, that file will be treated |
| 49 | as the accounting file; |
| 50 | .I /var/account/acct |
| 51 | is the default. |
| 52 | .PP |
| 53 | Output fields are labeled: \*(lqcpu\*(rq for the sum of user+system time |
| 54 | (in minutes), \*(lqre\*(rq for real time (also in minutes), |
| 55 | \*(lqk\*(rq for cpu-time averaged core usage (in 1k units), |
| 56 | \*(lqavio\*(rq for average number of i/o operations per execution. |
| 57 | With options fields labeled \*(lqtio\*(rq for total i/o operations, |
| 58 | \*(lqk*sec\*(rq for cpu storage integral (kilo-core seconds), \*(lqu\*(rq and \*(lqs\*(rq |
| 59 | for user and system cpu time alone (both in minutes) will sometimes appear. |
| 60 | .PP |
| 61 | There are near a googol of options: |
| 62 | .PP |
| 63 | .TP |
| 64 | a |
| 65 | Print all command names, even those containing unprintable characters |
| 66 | and those used only once. By default, those are placed under the |
| 67 | name `***other.' |
| 68 | .TP |
| 69 | b |
| 70 | Sort output by sum of user and system time divided by number of calls. |
| 71 | Default sort is by sum of user and system times. |
| 72 | .TP |
| 73 | c |
| 74 | Besides total user, system, and real time for each command print percentage |
| 75 | of total time over all commands. |
| 76 | .TP |
| 77 | d |
| 78 | Sort by average number of disk i/o operations. |
| 79 | .TP |
| 80 | D |
| 81 | Print and sort by total number of disk i/o operations. |
| 82 | .TP |
| 83 | f |
| 84 | Force no interactive threshold compression with \-v flag. |
| 85 | .TP |
| 86 | i |
| 87 | Don't read in summary file. |
| 88 | .TP |
| 89 | j |
| 90 | Instead of total minutes time for each category, give seconds per call. |
| 91 | .TP |
| 92 | k |
| 93 | Sort by cpu-time average memory usage. |
| 94 | .TP |
| 95 | K |
| 96 | Print and sort by cpu-storage integral. |
| 97 | .TP |
| 98 | l |
| 99 | Separate system and user time; normally they are combined. |
| 100 | .TP |
| 101 | m |
| 102 | Print number of processes and number of CPU minutes for each user. |
| 103 | .TP |
| 104 | n |
| 105 | Sort by number of calls. |
| 106 | .TP |
| 107 | r |
| 108 | Reverse order of sort. |
| 109 | .TP |
| 110 | s |
| 111 | Merge accounting file into summary file |
| 112 | .I /var/account/savacct |
| 113 | when done. |
| 114 | .TP |
| 115 | t |
| 116 | For each command report ratio of real time to the sum of user and system times. |
| 117 | .TP |
| 118 | u |
| 119 | Superseding all other flags, print for each command in the accounting file the |
| 120 | user ID and command name. |
| 121 | .TP |
| 122 | v |
| 123 | Followed by a number |
| 124 | .I n, |
| 125 | types the name of each command used |
| 126 | .I n |
| 127 | times or fewer. |
| 128 | Await a reply from the terminal; if it begins with `y', add the command to |
| 129 | the category `**junk**.' This is used to strip out garbage. |
| 130 | .TP |
| 131 | S |
| 132 | The following filename is used as the command summary file instead of |
| 133 | .I /var/account/savacct. |
| 134 | .TP |
| 135 | U |
| 136 | The following filename is used instead of |
| 137 | .I /var/account/usracct |
| 138 | to accumulate the per-user statistics printed by the \-m option. |
| 139 | .dt |
| 140 | .SH FILES |
| 141 | .ta 2i |
| 142 | /var/account/acct raw accounting |
| 143 | .br |
| 144 | /var/account/savacct summary |
| 145 | .br |
| 146 | /var/account/usracct per-user summary |
| 147 | .SH "SEE ALSO" |
| 148 | ac(8), acct(2) |
| 149 | .SH BUGS |
| 150 | The number of options to this program is absurd. |