ACCTSH(8) System Manager's Manual ACCTSH(8)
chargefee, ckpacct, dodisk, lastlogin, monacct, nulladm, prctmp,
prdaily, prtacct, runacct, shutacct, startup, turnacct - shell proce-
dures for accounting
/usr/lib/acct/chargefee login-name number
/usr/lib/acct/ckpacct [ blocks ]
/usr/lib/acct/dodisk [ -o ] [ filename... ]
/usr/lib/acct/prdaily [ -cl ] [ mmdd ]
/usr/lib/acct/prtacct filename [ heading ]
/usr/lib/acct/runacct [ mmdd ] [ mmdd state ]
/usr/lib/acct/shutacct [ reason ]
chargefee can be invoked to charge a number of units to login-name. A
record is written to /var/adm/fee, to be merged with other accounting
records during the night.
ckpacct should be initiated by cron(8) every hour. It periodically
checks the size of /var/adm/pacct. If the size exceeds blocks, 1000 by
default, turnacct is called with the argument switch. If the number of
free disk blocks in the /usr file system falls below 500, ckpacct auto-
matically turns off the collection of process accounting records using
the off argument to turnacct. When at least this number of blocks is
restored, accounting is activated again. This feature is sensitive to
the frequency at which ckpacct is executed, usually by cron.
dodisk should be executed by cron to perform the disk accounting func-
tions. By default, it does disk accounting on the 4.2 file systems in
/etc/fstab. filenames specify the one or more filesystem names where
disk accounting will be done. If filenames are used, disk accounting
will be done on these filesystems only. They should be the special
file names of mountable filesystems.
lastlogin is invoked by runacct to update /var/adm/acct/sum/loginlog,
which shows the last date on which each person logged in. lastlogin
deletes the entries of users no longer in /etc/passwd and creates new
monacct should be invoked once each month or each accounting period.
number indicates which month or period it is. If number is not given,
it defaults to the current month (01-12). This default is useful if
monacct is executed by cron(8) on the first day of each month. monacct
creates summary files in /var/adm/acct/fiscal and restarts summary
files in /var/adm/acct/sum.
nulladm creates filename with mode 664 and insures that owner and group
are adm. It is called by various accounting shell procedures.
prctmp can be used to print the session record file with headings (nor-
mally /var/adm/acct/nite/ctmp created by acctcon1 (see acctcon(8)).
The heading specifies device, user ID, login name, prime connect time
(in seconds), non-prime connect time (in seconds), session starting
time (numeric) and starting date and time.
prdaily is invoked by runacct to format a report of the previous day's
accounting data. The report resides in /var/adm/acct/sum/rprtmmdd
where mmdd is the month and day of the report. The current daily
accounting reports may be printed by typing prdaily. Previous days'
accounting reports can be printed by using the mmdd option and specify-
ing the exact report date desired. Previous daily reports are cleaned
up and therefore inaccessible after each invocation of monacct.
prtacct can be used to format and print any total accounting (tacct)
file with headings. See Chapter 8 in the manual, for an explanation of
runacct performs the accumulation of connect, process, fee, and disk
accounting on a daily basis. It also creates summaries of command
usage. For more information, see runacct(8).
shutacct should be invoked during a system shutdown (usually in
/etc/shutdown) to turn process accounting off and append a "reason"
record to /var/adm/wtmp. If reason is not specified, shutdown is pro-
vided as a default reason.
startup should be called by /etc/rc to turn the accounting on whenever
the system is brought up.
turnacct is an interface to accton (see acct(8)) to turn process
accounting on or off. The switch argument turns accounting off, moves
the current /var/adm/pacct to the next free name in /var/adm/pacctincr
(where incr is a number starting with 1 and incrementing by one for
each additional pacct file), then turns accounting back on again. This
procedure is called by ckpacct and thus can be taken care of by cron
and used to keep pacct to a reasonable size. This command is
restricted to the super-user.
-o Do a slower version of disk accounting by login directory.
filenames should be mount points of mounted filesystem.
-c Prints a report of exceptional resource usage by command. This
may be used on current day's accounting data only.
-l Print a report of exceptional usage by login ID for the specifed
/etc/fstab list of file systems /var/adm/fee accumulator
/var/adm/pacct current file for per-process accounting
/var/adm/pacct* used if pacct gets large and during execution
of daily accounting procedure
/var/adm/wtmp login/logoff summary
/usr/lib/acct/ptelus.awk limits for exceptional usage by login id
/usr/lib/acct/ptecms.awk limits for exceptional usage by command name
/var/adm/acct/nite working directory
/usr/lib/acct directory of accounting commands
/var/adm/acct/sum summary directory, should be saved
acctcom(1), acct(2V), acct(5), utmp(5V), acct(8), acctcms(8), acct-
con(8), acctmerg(8), acctprc(8), cron(8), diskusg(8), fwtmp(8),
17 January 1990 ACCTSH(8)