run daily accounting
/usr/lib/acct/runacct [ mmdd [ state ] ]
runacct is the main daily accounting shell procedure.
It is normally initiated via
processes connect, fee, disk, and process accounting files.
It also prepares summary files for prdaily
or billing purposes.
takes care not to damage active accounting files or summary
files in the event of errors.
It records its progress by writing descriptive diagnostic
messages into active.
When an error is detected,
to root and adm; runacct then terminates.
uses a series of lock files to protect against re-invocation.
The files lock and lock1
are used to prevent simultaneous invocation, and lastdate
is used to prevent more than one invocation per day.
runacct breaks its processing into separate, restartable
``states'' using statefile to remember the last
It accomplishes this by writing the state name into
runacct then looks in statefile
to see what it has done and to determine what to process next.
States are executed in the following order:
Move active accounting files into working files.
Verify integrity of wtmp file,
correcting date changes if necessary.
Produce connect session records in intermediate
connect time format.
Convert intermediate connect time format records
into total accounting format records.
Convert process accounting records into total
accounting format records.
Merge the connect and process accounting records.
Convert output of chargefee into total accounting
format records and merge with connect and process accounting records.
Merge disk accounting records with connect,
process, and fee accounting records.
Merge the daily total accounting records in daytacct
with the summary total accounting records in /usr/adm/acct/sum/tacct.
Produce command summaries.
Any installation-dependent accounting programs can be included here.
Clean up temporary files and exit.
To restart runacct after a failure, first check the active
file for diagnostics, then fix 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.
The 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.
To start runacct:
nohup runacct 2> /usr/adm/acct/nite/fd2log &
To restart runacct:
nohup runacct 0601 2>> /usr/adm/acct/nite/fd2log &
To restart runacct at a specific state:
nohup runacct 0601 MERGE 2>> /usr/adm/acct/nite/fd2log &
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.
runacct is conformant with
AT&T SVID Issue 2.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003