8980 BIOS clock is sometimes one hour fast
[unleashed.git] / usr / src / man / man1m / acctsh.1m
blob6b2aef67be4fef755f6e502f1fb8cbae80e365ac
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 2002 Sun Microsystems, Inc.  All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH ACCTSH 1M "Mar 15, 2002"
7 .SH NAME
8 acctsh, chargefee, ckpacct, dodisk, lastlogin, monacct, nulladm, prctmp,
9 prdaily, prtacct, shutacct, startup, turnacct \- shell procedures for
10 accounting
11 .SH SYNOPSIS
12 .LP
13 .nf
14 \fB/usr/lib/acct/chargefee\fR \fIlogin-name\fR \fInumber\fR
15 .fi
17 .LP
18 .nf
19 \fB/usr/lib/acct/ckpacct\fR [\fIblocks\fR]
20 .fi
22 .LP
23 .nf
24 \fB/usr/lib/acct/dodisk\fR [\fB-o\fR] [\fIfilename\fR]...
25 .fi
27 .LP
28 .nf
29 \fB/usr/lib/acct/lastlogin\fR
30 .fi
32 .LP
33 .nf
34 \fB/usr/lib/acct/monacct\fR \fInumber\fR
35 .fi
37 .LP
38 .nf
39 \fB/usr/lib/acct/nulladm\fR \fIfilename\fR...
40 .fi
42 .LP
43 .nf
44 \fB/usr/lib/acct/prctmp\fR \fIfilename\fR
45 .fi
47 .LP
48 .nf
49 \fB/usr/lib/acct/prdaily\fR [\fB-c\fR] [\fB-l\fR] [\fImmdd\fR]
50 .fi
52 .LP
53 .nf
54 \fB/usr/lib/acct/prtacct\fR \fIfilename\fR ['' \fIheading\fR '']
55 .fi
57 .LP
58 .nf
59 \fB/usr/lib/acct/shutacct\fR ['' \fIreason\fR '']
60 .fi
62 .LP
63 .nf
64 \fB/usr/lib/acct/startup\fR
65 .fi
67 .LP
68 .nf
69 \fB/usr/lib/acct/turnacct\fR on | off | switch
70 .fi
72 .SH DESCRIPTION
73 .SS "chargefee Command"
74 .sp
75 .LP
76 \fBchargefee\fR can be invoked to charge a \fInumber\fR of units to
77 \fIlogin-name\fR. A record is written to \fB/var/adm/fee\fR, to be merged with
78 other accounting records by \fBrunacct\fR(1M).
79 .SS "ckpacct Command"
80 .sp
81 .LP
82 \fBckpacct\fR should be initiated using \fBcron\fR(1M) to periodically check
83 the size of \fB/var/adm/pacct\fR. If the size exceeds \fIblocks\fR, \fB500\fR
84 by default, \fBturnacct\fR will be invoked with argument \fBswitch\fR. To avoid
85 a conflict with \fBturnacct switch\fR execution in \fBrunacct\fR, do not run
86 \fBckpacct\fR and \fBrunacct\fR simultaneously. If the number of free disk
87 blocks in the \fB/var\fR file system falls below  \fB500\fR, \fBckpacct\fR will
88 automatically turn off the collection of process accounting records via the
89 \fBoff\fR argument to \fBturnacct\fR. When at least  \fB500\fR blocks are
90 restored,  the accounting will be activated again on the next invocation of
91 \fBckpacct\fR. This feature is sensitive to the frequency at which
92 \fBckpacct\fR is executed, usually by the \fBcron\fR(1M) command.
93 .SS "dodisk Command"
94 .sp
95 .LP
96 \fBdodisk\fR should be invoked by \fBcron\fR(1M) to perform the disk accounting
97 functions.
98 .SS "lastlogin Command"
99 .sp
101 \fBlastlogin\fR is invoked by \fBrunacct\fR(1M) to update
102 \fB/var/adm/acct/sum/loginlog\fR, which shows the last date on which each
103 person logged in.
104 .SS "monacct Command"
107 \fBmonacct\fR should be invoked once each month or each accounting period.
108 \fInumber\fR indicates which month or period it is. If \fInumber\fR is not
109 given, it defaults to the current month (01\(mi12). This default is useful if
110 \fBmonacct\fR is to executed using \fBcron\fR(1M) on the first day of each
111 month. \fBmonacct\fR creates summary files in \fB/var/adm/acct/fiscal\fR and
112 restarts the summary files in \fB/var/adm/acct/sum\fR.
113 .SS "nulladm Command"
116 \fBnulladm\fR creates \fIfilename\fR with mode 664 and ensures that owner and
117 group are \fBadm\fR. It is called by various accounting shell procedures.
118 .SS "prctmp Command"
121 \fBprctmp\fR can be used to print the session record file (normally
122 \fB/var/adm/acct/nite/ctmp\fR created by \fBacctcon1\fR (see
123 \fBacctcon\fR(1M)).
124 .SS "prdaily Command"
127 \fBprdaily\fR is invoked by \fBrunacct\fR(1M) to format a report of the
128 previous day's accounting data. The report resides in
129 \fB/var/adm/acct/sum/rprt/mmdd\fR where \fImmdd\fR is the month and day of the
130 report. The current daily accounting reports may be printed by typing
131 \fBprdaily\fR. Previous days' accounting reports can be printed by using the
132 \fImmdd\fR option and specifying the exact report date desired.
133 .SS "prtacct Command"
136 \fBprtacct\fR can be used to format and print any total accounting
137 (\fBtacct\fR)file.
138 .SS "shutacct Command"
141 \fBshutacct\fR is invoked during a system shutdown to turn process accounting
142 off and append a  \fIreason\fR record to \fB/var/adm/wtmpx\fR.
143 .SS "startup Command"
146 \fBstartup\fR can be invoked when the system is brought to a multi-user state
147 to turn process accounting on.
148 .SS "turnacct Command"
151 \fBturnacct\fR is an interface to \fBaccton\fR (see \fBacct\fR(1M)) to turn
152 process accounting \fBon\fR or \fBoff\fR. The \fBswitch\fR argument moves the
153 current \fB/var/adm/pacct\fR to the next free name in
154 \fB/var/adm/pacct.\fIincr\fR\fR (where \fIincr\fR is a number starting with
155 \fB0\fR and incrementing by one  for each additional \fBpacct\fR file), then
156 turns accounting back on again. This procedure is called by \fBckpacct\fR and
157 thus can be taken care of by the \fBcron\fR(1M) command and used to keep \fB
158 pacct\fR to a reasonable size.   \fBshutacct\fR uses \fBturnacct\fR to stop
159 process accounting.   \fBstartup\fR uses \fBturnacct\fR to start process
160 accounting.
161 .SH OPTIONS
164 The following options are supported:
166 .ne 2
168 \fB\fB-c\fR\fR
170 .RS 6n
171 This option prints a report of exceptional resource usage by command, and may
172 be used on current day's accounting data only.
176 .ne 2
178 \fB\fB-l\fR\fR
180 .RS 6n
181 This option prints a report of exceptional usage by login id for the specified
182 date. Previous daily reports are cleaned up and therefore inaccessible after
183 each invocation of \fBmonacct\fR.
187 .ne 2
189 \fB\fB-o\fR\fR
191 .RS 6n
192 This option uses \fBacctdusg\fR (see \fBacct\fR(1M)) to do a slower version of
193 disk accounting by login directory. \fIfilename\fRs specifies the one or more
194 filesystem names where disk accounting will be done.  If \fIfilename\fRs are
195 used, disk accounting will be done on these filesystems only. If the \fB-o\fR
196 option is used, \fIfilename\fRs should be mount points of mounted filesystems.
197 If the \fB-o\fR option is omitted, \fIfilename\fRs should be the special file
198 names of mountable filesystems.
201 .SH FILES
203 .ne 2
205 \fB\fB/etc/logadm.conf\fR\fR
207 .RS 30n
208 Configuration file for the \fBlogadm\fR(1M) command
212 .ne 2
214 \fB\fB/usr/lib/acct\fR\fR
216 .RS 30n
217 Holds all accounting commands listed in section \fB1M\fR of this manual
221 .ne 2
223 \fB\fB/usr/lib/acct/ptecms.awk\fR\fR
225 .RS 30n
226 Contains the limits for exceptional usage by command name
230 .ne 2
232 \fB\fB/usr/lib/acct/ptelus.awk\fR\fR
234 .RS 30n
235 Contains the limits for exceptional usage by login \fBID\fR
239 .ne 2
241 \fB\fB/var/adm/acct/fiscal\fR\fR
243 .RS 30n
244 Fiscal reports directory
248 .ne 2
250 \fB\fB/var/adm/acct/nite\fR\fR
252 .RS 30n
253 Working directory
257 .ne 2
259 \fB\fB/var/adm/acct/sum\fR\fR
261 .RS 30n
262 Summary directory that contains information for \fBmonacct\fR
266 .ne 2
268 \fB\fB/var/adm/acct/sum/loginlog\fR\fR
270 .RS 30n
271 File updated by last login
275 .ne 2
277 \fB\fB/var/adm/fee\fR\fR
279 .RS 30n
280 Accumulator for fees
284 .ne 2
286 \fB\fB/var/adm/pacct\fR\fR
288 .RS 30n
289 Current file for per-process accounting
293 .ne 2
295 \fB\fB/var/adm/pacct\fR\fIincr\fR\fR
297 .RS 30n
298 Used if \fBpacct\fR gets large and during execution of daily accounting
299 procedure
303 .ne 2
305 \fB\fB/var/adm/wtmpx\fR\fR
307 .RS 30n
308 History of user access and administration information
311 .SH SEE ALSO
314 \fBacctcom\fR(1), \fBacct\fR(1M), \fBacctcms\fR(1M), \fBacctcon\fR(1M),
315 \fBacctmerg\fR(1M), \fBacctprc\fR(1M), \fBcron\fR(1M), \fBfwtmp\fR(1M),
316 \fBlogadm\fR(1M), \fBrunacct\fR(1M), \fBacct\fR(2), \fBacct.h\fR(3HEAD),
317 \fButmpx\fR(4), \fBattributes\fR(5)
318 .SH NOTES
321 See \fBrunacct\fR(1M) for the main daily accounting shell script, which
322 performs the accumulation of connect, process, fee, and disk accounting on a
323 daily basis. It also creates summaries of command usage.