runacct(1M) runacct(1M)NAME runacct - runs daily accounting SYNOPSIS runacct [mmdd [state]] ARGUMENTS mmdd [state] Specifies the month and day that accounting was run, and the state of the processing. The processing states are executed in the following order; replace state with one of the following: SETUP Move active accounting files into working files. WTMPFIX Verify integrity of wtmp file, correcting date changes if necessary. CONNECT1 Produce connect session records in ctmp.h format. CONNECT2 Convert ctmp.h records into tacct.h format. PROCESS Convert process accounting records into tacct.h format. MERGE Merge the connect and process accounting records. FEES Convert output of chargefee(1M) into tacct.h format and merge with connect and process accounting records. DISK Merge disk accounting records with connect, process, and fee accounting records. MERGETACCT Merge the daily total accounting records in daytacct with the summary total accounting records in /usr/adm/acct/sum/tacct. CMS Produce command summaries. USEREXIT Any installation-dependent accounting programs can be included here. CLEANUP January 1992 1
runacct(1M) runacct(1M)Clean-up temporary files and exit. DESCRIPTION runacct is the main daily accounting shell procedure. It is normally initiated via cron(1M). runacct processes connect, fee, disk, and process accounting files. It also prepares summary files for prdaily or billing purposes. The runacct command takes care not to damage active accounting files or summary files in the event of errors. It records its progress by writing descriptive status messages into active. When an error is detected, a message is written to /dev/console, mail (see mail(1)) is sent to root and adm, and runacct terminates. The runacct command uses a series of lock files to protect against reinvocation. The files lock and lock1 are used to prevent simultaneous invocation, and lastdate is used to prevent more than one invocation per day. The runacct command breaks its processing into separate, restartable states using statefile to remember the last state completed. It accomplishes this by writing the state name into statefile. runacct then looks in statefile to see what it has done and to determine what to process next. To restart runacct after a failure, first check the active file for diagnostics, then fix up any corrupted data files, such as pacct or wtmp. The lock files and lastdate file must be removed before runacct can be restarted. The argument mmdd is necessary if runacct is being restarted, and specifies the month and day for which runacct will rerun the accounting. Entry point for processing is based on the contents of statefile; to override this, include the desired state on the command line to designate where processing should begin. EXAMPLES To start runnacct, enter: nohup runacct 2> /usr/adm/acct/nite/fd2log & To restart runacct, enter: nohup runacct 0601 2>> /usr/adm/acct/nite/fd2log & To restart runacct at a specific state, enter: nohup runacct 0601 MERGE 2>> /usr/adm/acct/nite/fd2log & 2 January 1992
runacct(1M) runacct(1M)LIMITATIONS Normally it is not a good idea to restart runacct in the SETUP state. Run SETUP manually and restart via: runacct mmdd WTMPFIX If runacct failed in the PROCESS state, remove the last ptacct file because it will not be complete. FILES /usr/lib/acct/runacct Executable file /etc/wtmp Temporary file /usr/adm/pacct* Accounting file /usr/src/cmd/acct/tacct.h Header file /usr/src/cmd/acct/ctmp.h Header file /usr/adm/acct/nite/active Accounting file /usr/adm/acct/nite/daytacct Accounting file /usr/adm/acct/nite/lock Lock file /usr/adm/acct/nite/lock1 Lock file /usr/adm/acct/nite/lastdate Accounting file /usr/adm/acct/nite/statefile Accounting file /usr/adm/acct/nite/ptacct*.mmdd Accounting files SEE ALSO acct(1M), acctcms(1M), acctcom(1M), acctcon(1M), acctmerg(1M), acctprc(1M), acctsh(1M), cron(1M), fwtmp(1M) mail(1) in A/UX Command Reference acct(2), acct(4), utmp(4) in A/UX Programmer's Reference January 1992 3