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"
8 acctsh, chargefee, ckpacct, dodisk, lastlogin, monacct, nulladm, prctmp,
9 prdaily, prtacct, shutacct, startup, turnacct \- shell procedures for
14 \fB/usr/lib/acct/chargefee\fR \fIlogin-name\fR \fInumber\fR
19 \fB/usr/lib/acct/ckpacct\fR [\fIblocks\fR]
24 \fB/usr/lib/acct/dodisk\fR [\fB-o\fR] [\fIfilename\fR]...
29 \fB/usr/lib/acct/lastlogin\fR
34 \fB/usr/lib/acct/monacct\fR \fInumber\fR
39 \fB/usr/lib/acct/nulladm\fR \fIfilename\fR...
44 \fB/usr/lib/acct/prctmp\fR \fIfilename\fR
49 \fB/usr/lib/acct/prdaily\fR [\fB-c\fR] [\fB-l\fR] [\fImmdd\fR]
54 \fB/usr/lib/acct/prtacct\fR \fIfilename\fR ['' \fIheading\fR '']
59 \fB/usr/lib/acct/shutacct\fR ['' \fIreason\fR '']
64 \fB/usr/lib/acct/startup\fR
69 \fB/usr/lib/acct/turnacct\fR on | off | switch
73 .SS "chargefee Command"
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).
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.
96 \fBdodisk\fR should be invoked by \fBcron\fR(1M) to perform the disk accounting
98 .SS "lastlogin Command"
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
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.
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
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
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
164 The following options are supported:
171 This option prints a report of exceptional resource usage by command, and may
172 be used on current day's accounting data only.
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.
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.
205 \fB\fB/etc/logadm.conf\fR\fR
208 Configuration file for the \fBlogadm\fR(1M) command
214 \fB\fB/usr/lib/acct\fR\fR
217 Holds all accounting commands listed in section \fB1M\fR of this manual
223 \fB\fB/usr/lib/acct/ptecms.awk\fR\fR
226 Contains the limits for exceptional usage by command name
232 \fB\fB/usr/lib/acct/ptelus.awk\fR\fR
235 Contains the limits for exceptional usage by login \fBID\fR
241 \fB\fB/var/adm/acct/fiscal\fR\fR
244 Fiscal reports directory
250 \fB\fB/var/adm/acct/nite\fR\fR
259 \fB\fB/var/adm/acct/sum\fR\fR
262 Summary directory that contains information for \fBmonacct\fR
268 \fB\fB/var/adm/acct/sum/loginlog\fR\fR
271 File updated by last login
277 \fB\fB/var/adm/fee\fR\fR
286 \fB\fB/var/adm/pacct\fR\fR
289 Current file for per-process accounting
295 \fB\fB/var/adm/pacct\fR\fIincr\fR\fR
298 Used if \fBpacct\fR gets large and during execution of daily accounting
305 \fB\fB/var/adm/wtmpx\fR\fR
308 History of user access and administration information
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)
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.