Debian Codegraph @

upstream/debian-unstable/man1/ac.1

raw
1 .TH AC 1 "2010 August 16"
2 .SH NAME
3 ac \- print statistics about users' connect time
4 .SH SYNOPSIS
5 .hy 0
6 .na
7 .TP
8 .B ac
9 [
10 .B \-d
11 |
12 .B \-\-daily-totals
13 ]
14 [
15 .B \-y
16 |
17 .B \-\-print-year
18 ]
19 .br
20 [
21 .B \-p
22 |
23 .B \-\-individual-totals
24 ]
25 [
26 .I people
27 ]
28 .br
29 [
30 .B \-f
31 |
32 .B \-\-file
33 .I filename
34 ]
35 [
36 .B \-a
37 |
38 .B \-\-all-days
39 ]
40 .br
41 [
42 .B \-\-complain
43 ]
44 [
45 .B \-\-reboots
46 ]
47 [
48 .B \-\-supplants
49 ]
50 .br
51 [
52 .B \-\-timewarps
53 ]
54 [
55 .B \-\-compatibility
56 ]
57 .br
58 [
59 .B \-\-tw-leniency
60 .I num
61 ]
62 [
63 .B \-\-tw-suspicious
64 .I num
65 ]
66 .br
67 [
68 .B \-z
69 |
70 .B \-\-print-zeros
71 ]
72 [
73 .B \-\-debug
74 ]
75 .br
76 [
77 .B \-V
78 |
79 .B \-\-version
80 ]
81 [
82 .B \-h
83 |
84 .B \-\-help
85 ]
86 .ad b
87 .hy 1
88 .SH DESCRIPTION
89 .LP
90 .B ac
91 prints out a report of connect time (in hours) based on the
92 logins/logouts in the current
93 .I wtmp
94 file. A total is also printed out.
95 .LP
96 The accounting file
97 .I wtmp
98 is maintained by
99 .BR init (8)
100 and
101 .BR login (1).
102 Neither
103 .B ac
104 nor
105 .B login
106 creates the
107 .I wtmp
108 if it doesn't exist, no accounting is done. To begin accounting, create
109 the file with a length of zero.
110 .LP
111 NOTE: The
112 .I wtmp
113 file can get really big, really fast. You might want to trim it every
114 once and a while.
115 .LP
116 GNU
117 .B ac
118 works nearly the same UNIX
119 .BR ac ,
120 though it's a little
121 smarter in several ways. You should therefore expect differences in
122 the output of GNU
123 .B ac
124 and the output of
125 .BR ac 's
126 on other systems.
127 Use the command
128 .BI info " accounting"
129 to get additional information.
130 .SH OPTIONS
131 .PD 0
132 .TP
133 .B \-d, \-\-daily-totals
134 Print totals for each day rather than just one big total at the
135 end. The output looks like this:
136 Jul 3 total 1.17
137 Jul 4 total 2.10
138 Jul 5 total 8.23
139 Jul 6 total 2.10
140 Jul 7 total 0.30
141 .TP
142 .B \-p, \-\-individual-totals
143 Print time totals for each user in addition to the usual
144 everything-lumped-into-one value. It looks like:
145 bob 8.06
146 goff 0.60
147 maley 7.37
148 root 0.12
149 total 16.15
150 .TP
151 .I people
152 Print out the sum total of the connect time used by all of the
153 users included in
154 .I people.
155 Note that
156 .I people
157 is a space separated list of valid user names; wildcards are not allowed.
158 .TP
159 .BI "\-f, \-\-file " filename
160 Read from the file
161 .I filename
162 instead of the system's
163 .I wtmp
164 file.
165 .TP
166 .B \-\-complain
167 When the
168 .I wtmp
169 file has a problem (a time-warp, missing record, or
170 whatever), print out an appropriate error.
171 .TP
172 .B \-\-reboots
173 Reboot records are NOT written at the time of a reboot, but when
174 the system restarts; therefore, it is impossible to know exactly
175 when the reboot occurred. Users may have been logged into the
176 system at the time of the reboot, and many
177 .B ac's
178 automatically
179 count the time between the login and the reboot record
180 against the user (even though all of that time shouldn't be, perhaps,
181 if the system is down for a long time, for instance). If you want to
182 count this time, include the flag.
183 *For vanilla
184 .B ac
185 compatibility, include this flag.*
186 .TP
187 .B \-\-supplants
188 Sometimes, a logout record is not written for a specific terminal,
189 so the time that the last user accrued cannot be calculated. If
190 you want to include the time from the user's login to the next
191 login on the terminal (though probably incorrect), include this
192 you want to include the time from the user's login to the next
193 login on the terminal (though probably incorrect), include this
194 flag.
195 *For vanilla
196 .B ac
197 compatibility, include this flag.*
198 .TP
199 .B \-\-timewarps
200 Sometimes, entries in a
201 .I wtmp
202 file will suddenly jump back into the past without a clock change
203 record occurring. It is impossible to know how long a user was logged
204 in when this occurs. If you want to count the time between the login
205 and the time warp against the user, include this flag. *For vanilla
206 .B ac
207 compatibility, include this flag.*
208 .TP
209 .B \-\-compatibility
210 This is shorthand for typing out the three above options.
211 .TP
212 .B \-a, \-\-all-days
213 If we're printing daily totals, print a record for every day instead of
214 skipping intervening days where there is no login activity. Without
215 this flag, time accrued during those intervening days gets listed under
216 the next day where there is login activity.
217 .TP
218 .BI \-\-tw-leniency " num"
219 Set the time warp leniency to
220 .I num
221 seconds. Records in
222 .I wtmp
223 files might be slightly out of order (most notably when two logins
224 occur within a one-second period - the second one gets written first).
225 By default, this value is set to 60. If the program notices this
226 problem, time is not assigned to users unless the
227 .B \-\-timewarps
228 flag is used.
229 .TP
230 .BI \-\-tw-suspicious " num"
231 Set the time warp suspicious value to
232 .I num
233 seconds. If two records in the
234 .I wtmp
235 file are farther than this number of seconds apart, there is a problem
236 with the
237 .I wtmp
238 file (or your machine hasn't been used in a year). If the program
239 notices this problem, time is not assigned to users unless the
240 .B \-\-timewarps
241 flag is used.
242 .TP
243 .B \-y, \-\-print-year
244 Print year when displaying dates.
245 .TP
246 .B \-z, \-\-print-zeros
247 If a total for any category (save the grand total) is zero, print it.
248 The default is to suppress printing.
249 .TP
250 .B \-\-debug
251 Print verbose internal information.
252 .TP
253 .B \-V, \-\-version
254 Print the version number of
255 .B ac
256 to standard output and quit.
257 .TP
258 .B \-h, \-\-help
259 Prints the usage string and default locations of system files to
260 standard output and exits.
261 .SH FILES
262 .I wtmp
263 .RS
264 The system wide login record file. See
265 .BR wtmp (5)
266 for further details.
267 .LP
268
269 .SH AUTHOR
270 The GNU accounting utilities were written by Noel Cragg
271 <[email protected]>. The man page was adapted from the accounting
272 texinfo page by Susan Kleinmann <[email protected]>.
273 .SH "SEE ALSO"
274 .BR login (1),
275 .BR wtmp (5),
276 .BR init (8),
277 .BR sa (8)