acctcms Command
Purpose
Produces command-usage summaries from accounting records.
Syntax
/usr/sbin/acct/acctcms [ -t | -a [ -o
] [ -p ]] [ -c ] [ -j ] [ -n
] [ -s ] [
File ... ]
Description
The acctcms command reads each file that is specified by the File parameter, adds and sorts all records for identically named processes, and writes the records to standard output. By default, the output file is in binary format. Input files are usually in the acct file format.
When you use the -o and -p flags together, the acctcms command produces a report that combines prime and nonprime time. Prime and nonprime times are defined by entries in the /etc/acct/holidays file. Prime times are assumed to be the period when the system is most active, such as weekdays. Saturdays and Sundays are always nonprime time for the accounting systems, as are any holidays that you specify in the /etc/acct/holidays file. All the output summaries are of total usage, except for number of times run, CPU minutes, and real minutes, which are split into prime and nonprime minutes.
Flags
Item | Description |
---|---|
-a | Displays output in ASCII summary format rather than binary summary format. Each output line
contains the command name, the number of times the command was run, total kcore time (memory
measurement in KB segments), total CPU time, total real time, mean memory size (in K-bytes), mean
CPU time per invocation of the command, and the CPU usage factor. The listed times are all in
minutes. The acctcms command normally sorts its output by total kcore minutes.
The unit kcore minutes are a measure of the amount of memory used (in KB) multiplied by the amount
of time that it was in use. This flag cannot be used with the -t flag. Use
the following options only with the -a option:
The default items have the following headings in the output:
|
-c | Sorts by total CPU time rather than total kcore minutes. When this flag is used with the -n flag, only the -n flag takes effect. |
-j | Combines all commands that are called only one time under the heading other. |
-n | Sorts by the number of times the commands were called. When this flag is used with the -c flag, only the -n flag takes effect. |
-o | Displays a command summary of nonprime time commands. You can use this flag only when the -a flag is used. |
-p | Displays a command summary of prime time commands. You can use this flag only when the -a flag is used. |
-s | Assumes that any named files that follow this flag are already in binary format. |
-t | Processes all records as total accounting records. The default binary format splits each field into prime and nonprime time sections. This option combines the prime and nonprime time parts into a single field that is the total of both, and provides upward compatibility with old style acctcms binary summary format records. This flag cannot be used with the -a flag. |
Security
Access Control: The acctcms command grant executes (x) access only to members of the adm group.
Examples
To collect daily command accounting records in a today file and maintain a running total in a total file, add the following to a shell script:
acctcms File . . . > today
cp total previoustotal
acctcms -s today previoustotal > total
acctcms -a -s total
The File parameters that you specify are redirected to a file called today, added to the previous total (in a file renamed previoustotal) to produce a new total (called total). All files are binary files. In the last line, the -a flag displays the total file in ASCII format so you can view the report.
Files
Item | Description |
---|---|
/etc/acct/holidays | Specifies prime and nonprime time for accounting records. |
/usr/sbin/acct/acctcms | Contains the acctcms command. |