Installation guide

12.4.3 The acctwtmp Command
The acctwtmp command allows you to write a reason string and the
current time and date to a utmp.h structured file, usually the
/var/adm/wtmp file. The runacct, startup, and shutacct shell scripts
invoke the acctwtmp command to record when the runacct script is
invoked and when system accounting is turned on and off.
The acctwtmp command has the following syntax:
/usr/sbin/acct/acctwtmp reason
The
reason
variable must have a maximum of sizeof(ut_line)
characters and be enclosed in quotation marks (" ").
12.4.4 The ac Command
The ac command displays connect session records from files with the utmp
file structure shown in Table 12–6. You can use the command to perform
system diagnostics and determine user charges. The ac command displays
the total connect time for all users or the total connect time for the
specified users. The connect time is given in hours rounded to the nearest
hundredth. To automatically generate total user connect session files, you
can include the ac command in the /usr/spool/cron/crontab/adm file
or modify the runacct shell script and include the ac command. Refer to
Section 12.2.4 for information on setting up automatic accounting.
The ac command has the following syntax:
/usr/sbin/ac
[d][p][w filename][username...]
Refer to the ac(8) reference page for information on command options.
The default behavior displays the sum of the system connect time for all
users. For example:
# /usr/sbin/ac
"total 48804.26"
The following command displays the total connect time according to user
name:
# /usr/sbin/ac p
buckler 61.44
fujimori 530.94
newsnug 122.38
dara 0.10
root 185.98
buchman 339.33
russell 53.96
Administering the System Accounting Services 12–17