Content-type: text/html
acctmerg - Merges total-accounting files into an intermediary file or a daily accounting file
acctmerg -[ahipv] [specification] -[tu] [file ....]
The acctmerg command combines process, connect time, fee, disk usage, and queuing (printer) total-accounting records in tacct binary or tacct ASCII format (see the tacct structure in the acct.h file format for a description of this total-accounting format). The acctmerg command writes the results of record processing to standard output. The accounting file produced by the acctmerg command may have entries for as many as 18 columns. Column headings are printed only when you use the -h flag. The following table lists the column headings by number, the column heading by label, and the purpose of the entry: User ID. This is the integer value of the user ID from the /etc/passwd file. User login name. This is the alpha user login name from the /etc/passwd file. Prime-time CPU run time. This is the total time in seconds that prime-time CPU run time was charged to the user during the active accounting period. Nonprime-time CPU run time. This is the total time in seconds that nonprime-time CPU run time was charged to the named user. Prime-time memory K-core. This is a measure of memory usage during prime time. This value expresses the amount of memory used and the elapsed amount of prime time during which it was used (K-core is the product of total CPU time in minutes and mean size of memory used). Nonprime-time memory K-core. This is a measure of memory usage during nonprime time. Prime-time read and write characters. This is the total number of characters transferred during prime-time operation. Nonprime-time read and write characters. This is the total number of characters transferred during nonprime-time operation. Prime-time number of I/O blocks. This is the total number of I/O blocks transferred during prime-time read and write operations. The number of bytes in an I/O block is implementation dependent. Nonprime-time number of I/O blocks. This is the total number of I/O blocks transferred during nonprime-time read and write operations. Prime-time connect duration. This is the total number of prime-time seconds during which a connection existed. Nonprime-time connect duration. This is the total number of nonprime-time seconds during which a connection existed. Disk blocks used. This is the total number of disk blocks used. Number of pages printed. This is the total number of pages queued to any printers in the system. Special fee charge units. This is the number of integer units to charge for any special fee. This value is the one supplied when the /usr/sbin/acct/chargefee command is processed during the active accounting period. Number of processes. This is the total number of processes spawned by the user during the active accounting period. Number of logins. This is the total number of times the user logged in during the active accounting period. Number of disk-accounting samples. This is the total number of times during the active accounting period that the disk-accounting command was used to get the total number of disk blocks listed in the DSK_BLOCKS column. When the value in the DSK_BLOCKS column is divide by this number, the average number of disk blocks used during the accounting period is obtained.
Total accounting records are read from standard input and any additional files (up to nine) you specify with the file parameter. File records are merged according to identical keys, usually the user ID and user login name. To optimize processing performance, output is written in binary, unless the -a or -v flag is used.
Normally the acctmerg command is called from the runacct shell procedure, either to produce an intermediate file (/var/adm/acct/nite/daytacct, for example) when one or more source accounting files is full, or to merge intermediate files into a cumulative total (/var/adm/acct/sum/tacct, is another example). The cumulative total daily files are the source from which the monacct command produces an ASCII monthly summary file, which is written to the /var/adm/acct/fiscal subdirectory.
The optional specification parameter allows you to select input or output column entries, as illustrated in Example 1. Field specifications are a comma-separated string of field numbers. Field numbers are referenced in boldface type in the first column of the foregoing list together with their respective column headings. When you specify field numbers they should be listed in the order specified by the boldfaced heading reference numbers.
Inclusive field ranges may also be specified, with array sizes properly taken into account except for the ta_name number of characters. For example, -h2-3,11,15-13,2 displays the LOGNAME (2), PRI_CPU (3), PRI_CONNECT time (11), FEES (15), PRINT (14), DISK_BLOCKS (13), and again LOGNAME (2), in that order, with the described column headings (-h). The default specification is to output all 18 columns (1-18 or 1-), which produces rather wide output records that contain all the available accounting data.
Queuing system, disk usage, or fee data can be converted into tacct records with the acctmerge command, using the -i flag and the specification parameter.
Commands: acct(8), acctcms(8), acctcom(8), acctcon(8), acctdisk(8), acctprc(8), fwtmp(8), runacct(8)
Functions: acct(2) delim off