AC(8) BSD System Manager's Manual AC(8)NAMEac - display connect time accounting
SYNOPSISac [-dp] [-w file] [users ...]
DESCRIPTION
If the file /var/log/wtmp exists, a record of system event and individual
login and logout times are written to it by init(8) and login(8). The
program ac examines these records and writes the accumulated connect time
for individual logins to the standard output.
The following options are available:
-d Display the connect times in 24 hour periods.
-p Display individual user totals.
-w file
Read raw connect time data from file instead of the default file
/var/log/wtmp.
If user arguments are specified, information is given for only those
users. Otherwise, ac displays information for all users for which there
is data.
The wtmp file will grow forever, and therefore must be periodically trun-
cated. This is normally done by the daemon script /etc/monthly, (sched-
uled by cron(8)), which renames and rotates the wtmp files before trun-
cating them (retaining about six month's worth). No information is col-
lected however, if the wtmp file does not exist.
All users are presumed to have logged out if the system shuts down or re-
boots.
Any logout records without preceding login records are ignored, thus user
sessions starting before the raw data begins will not be included in the
report. For this reason, ac may not correctly present data for users
that were logged in when the wtmp files were rotated. To obtain correct
data, either request data on a per-day basis (the -d option) or concate-
nate multiple log files together in their creation order and run ac on
the result.
Any login records without subsequent logout records when the raw data
ends will be treated as if the user logged out at midnight of the last
day for which there is any login record, or as of the current time-of-
day, whichever is earlier.
FILES
/var/log/wtmp
/var/log/wtmp.[0-7] rotated files
SEE ALSOutmp(5), init(8), login(8), sa(8)HISTORY
An ac command appeared in Version 6 AT&T UNIX.
4th Berkeley Distribution April 19, 1994 1