xref: /original-bsd/usr.sbin/ac/ac.8 (revision 7afc0fa3)
1.\" Copyright (c) 1980, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)ac.8	8.2 (Berkeley) 04/19/94
7.\"
8.Dd
9.Dt AC 8
10.Os BSD 4
11.Sh NAME
12.Nm ac
13.Nd display connect time accounting
14.Sh SYNOPSIS
15.Nm ac
16.Op Fl d
17.Op Fl p
18.Op Fl w Ar file
19.Op Ar users ...
20.Sh DESCRIPTION
21If the file
22.Pa /var/log/wtmp
23exists,
24a record of individual
25login and logout times are written to it by
26.Xr init 8
27and
28.Xr login 8
29respectively.
30The program
31.Nm ac
32examines these
33records and writes the accumulated connect time for all logins to the
34standard output.
35.Pp
36Options available:
37.Bl -tag -width people
38.It Fl d
39Display the connect times in 24 hour chunks.
40.It Fl p
41Display individual user totals.
42.It Fl w Ar file
43Read raw connect time data from
44.Ar file
45instead of the default file
46.Pa /var/log/wtmp .
47.It Ar users ...
48Display totals for the given individuals
49only.
50.El
51.Pp
52If no arguments are given,
53.Nm
54displays the total amount of login time for all active accounts on the
55system.
56.Pp
57The default
58.Pa wtmp
59file is an infinitely increasing file
60unless frequently truncated.  This is normally
61done by the daily daemon scripts scheduled by
62.Xr cron 8
63which rename and rotate the
64.Pa wtmp
65files before truncating them (and keeping about a weeks worth on hand).
66No login times are collected however, if the file does not exist.
67.Sh FILES
68.Bl -tag -width /var/log/wtmp.[0-7] -compact
69.It Pa /var/log/wtmp
70.It Pa /var/log/wtmp.[0-7]
71rotated files
72.El
73.Sh SEE ALSO
74.Xr init 8 ,
75.Xr sa 8 ,
76.Xr login 1 ,
77.Xr utmp 5 .
78.Sh HISTORY
79A
80.Nm
81command appeared in Version 6 AT&T UNIX.
82