acctcms(8) — Maintenance
OSF
NAME
acctcms − Produces command usage summaries from accounting records
SYNOPSIS
acctcms [-acjnspot] file ...
FLAGS
-aDisplays output in ASCII summary format rather than binary summary format. Each output line contains the following information under its own heading: command name, the number of times the command was run, total K-core time, total CPU time, total real time, mean memory size in kilobytes (KB), mean CPU time per command, CPU usage (called hog factor), the number of characters transferred, and the number of blocks read. All times are expressed in minutes. The acctcms command normally sorts its output in descending order by total K-core minutes. The unit K-core minutes is a measure of the amount of storage used (in KB) multiplied by the amount of time the buffer was in use. The hog factor is the total CPU time divided by the total real time. The default command summary output format has the following headings:
•COMMAND NAME
•NUMBER CMDS
•TOTAL KOREMIN
•TOTAL CPU-MIN
•TOTAL REAL-MIN
•MEAN SIZE-K
•MEAN CPU-MIN
•HOG FACTOR
•CHAR TRNSFD
•BLOCKS READ
-cSorts in descending order by total CPU time rather than total K-core minutes.
-jCombines all commands called only once by writing "∗∗∗other" in the COMMAND NAME column.
-nSorts in decending order by the number of times each command was called.
-oDisplays a command summary of nonprime-time commands.
-pDisplays a command summary of prime-time commands.
-sAssumes that any named file that follows this flag is in binary format.
-tProcesses all records as total accounting records. The default binary format splits each heading into prime time and nonprime-time parts.
DESCRIPTION
The acctcms command outputs data in a format called TOTAL COMMAND SUMMARY. This command reads each file specified by the file parameter, combines and sorts all records for identically named processes, and writes them in a binary format to the output device. Files are usually organized in the acct file format. When you use the -o and -p flags together, the acctcms command produces a summary report that combines commands processed during both prime and nonprime time. All the output summaries specify total usage, except for the number of times run, CPU minutes, and real minutes, which are split into prime and nonprime minutes.
EXAMPLES
To collect command accounting records from one or more source files into a command summary file called today and to maintain a running total summary of commands in a file called cmtotal, add the following lines to an accounting shell script:
acctcms [source File(s) ....] > today
cp total prev_tot
acctcms -s today prev_tot > cmtotal
acctcms -a -s cmtotal
First, the acctcms command is used to redirect command records in File(s) that you specify to a file called today. Next the old total command summary file is renamed prev_tot. Then the command summary records that are collected in the today and the prev_tot files are redirected to a new command summary file called cmtotal. These are all binary files. The last acctcms command outputs to the default output device the contents of the cmtotal file in the ASCII default command summary format previously described, so that the report may be viewed.
FILES
/usr/sbin/acct/acctcms
Specifies the command path.
/usr/sbin/acct/holidays
This is where prime time is set.
/usr/include/sys/acct.h, /usr/include/utmp.h
Accounting header files that define formats for writing accounting files.
RELATED INFORMATION
Commands: acct(8), runacct(8)
Functions: acct(2)