1AC(1)                       General Commands Manual                      AC(1)
2
3
4

NAME

6       ac -  print statistics about users' connect time
7

SYNOPSIS

9       ac     [ -d | --daily-totals ] [ -y | --print-year ]
10              [ -p | --individual-totals ] [ people ]
11              [ -f | --file filename ] [ -a | --all-days ]
12              [ --complain ] [ --reboots ] [ --supplants ]
13              [ --timewarps ] [ --compatibility ]
14              [ --tw-leniency num ] [ --tw-suspicious num ]
15              [ -z | --print-zeros ] [ --debug ]
16              [ -V | --version ] [ -h | --help ]
17

DESCRIPTION

19       ac  prints  out  a  report  of connect time (in hours) based on the lo‐
20       gins/logouts in the current wtmp file.  A total is also printed out.
21
22       The accounting file wtmp is maintained by init(8) and  login(1).   Nei‐
23       ther  ac  nor login creates the wtmp if it doesn't exist, no accounting
24       is done.  To begin accounting, create the file with a length of zero.
25
26       NOTE:  The wtmp file can get really big, really fast.  You  might  want
27       to trim it every once and a while.
28
29       GNU  ac  works nearly the same UNIX ac, though it's a little smarter in
30       several ways.  You should therefore expect differences in the output of
31       GNU  ac  and the output of ac's on other systems.  Use the command info
32       accounting to get additional information.
33

OPTIONS

35       -d, --daily-totals
36              Print totals for each day rather than just one big total at  the
37              end.  The output looks like this:
38                      Jul  3  total     1.17
39                      Jul  4  total     2.10
40                      Jul  5  total     8.23
41                      Jul  6  total     2.10
42                      Jul  7  total     0.30
43       -p, --individual-totals
44              Print  time totals for each user in addition to the usual every‐
45              thing-lumped-into-one value.  It looks like:
46                      bob       8.06
47                      goff      0.60
48                      maley     7.37
49                      root      0.12
50                      total    16.15
51       people Print out the sum total of the connect time used by all  of  the
52              users included in people.  Note that people is a space separated
53              list of valid user names; wildcards are not allowed.
54       -f, --file filename
55              Read from the file filename instead of the system's wtmp file.
56       --complain
57              When the wtmp file has a problem (a time-warp,  missing  record,
58              or whatever), print out an appropriate error.
59       --reboots
60              Reboot records are NOT written at the time of a reboot, but when
61              the system restarts; therefore, it is impossible to know exactly
62              when  the  reboot occurred.  Users may have been logged into the
63              system at the time of the reboot, and  many  ac's  automatically
64              count  the  time between the login and the reboot record against
65              the user (even though all of that time shouldn't be, perhaps, if
66              the  system is down for a long time, for instance).  If you want
67              to count this time, include the flag.  *For vanilla ac  compati‐
68              bility, include this flag.*
69       --supplants
70              Sometimes,  a logout record is not written for a specific termi‐
71              nal, so the time that the last user accrued cannot be  calculat‐
72              ed.   If  you  want to include the time from the user's login to
73              the next login on the terminal (though probably incorrect),  in‐
74              clude this you want to include the time from the user's login to
75              the next login on the terminal (though probably incorrect),  in‐
76              clude  this  flag.   *For vanilla ac compatibility, include this
77              flag.*
78       --timewarps
79              Sometimes, entries in a wtmp file will suddenly jump  back  into
80              the  past without a clock change record occurring.  It is impos‐
81              sible to know how long a user was logged in  when  this  occurs.
82              If  you  want  to  count the time between the login and the time
83              warp against the user, include this flag.  *For vanilla ac  com‐
84              patibility, include this flag.*
85       --compatibility
86              This is shorthand for typing out the three above options.
87       -a, --all-days
88              If we're printing daily totals, print a record for every day in‐
89              stead of skipping intervening days where there is no  login  ac‐
90              tivity.   Without this flag, time accrued during those interven‐
91              ing days gets listed under the next day where there is login ac‐
92              tivity.
93       --tw-leniency num
94              Set  the  time  warp  leniency  to num seconds.  Records in wtmp
95              files might be slightly out of order (most notably when two  lo‐
96              gins  occur  within  a  one-second  period - the second one gets
97              written first).  By default, this value is set to  60.   If  the
98              program  notices this problem, time is not assigned to users un‐
99              less the --timewarps flag is used.
100       --tw-suspicious num
101              Set the time warp suspicious  value  to  num  seconds.   If  two
102              records in the wtmp file are farther than this number of seconds
103              apart, there is a problem with the wtmp file  (or  your  machine
104              hasn't  been used in a year).  If the program notices this prob‐
105              lem, time is not assigned to users unless the  --timewarps  flag
106              is used.
107       -y, --print-year
108              Print year when displaying dates.
109       -z, --print-zeros
110              If  a  total  for  any  category (save the grand total) is zero,
111              print it.  The default is to suppress printing.
112       --debug
113              Print verbose internal information.
114       -V, --version
115              Print the version number of ac to standard output and quit.
116       -h, --help
117              Prints the usage string and default locations of system files to
118              standard output and exits.

FILES

120       wtmp
121              The  system  wide login record file. See wtmp(5) for further de‐
122              tails.

AUTHOR

124       The   GNU   accounting   utilities   were   written   by   Noel   Cragg
125       <noel@gnu.ai.mit.edu>.  The  man  page  was adapted from the accounting
126       texinfo page by Susan Kleinmann <sgk@sgk.tiac.net>.

SEE ALSO

128       login(1), wtmp(5), init(8), sa(8)
129
130
131
132                                2010 August 16                           AC(1)
Impressum