2 .\" Copyright 1989 AT&T Copyright (c) 1999 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 RUNACCT 1M "May 11, 1999"
8 runacct \- run daily accounting
12 \fB/usr/lib/acct/runacct\fR [\fImmdd\fR [\fIstate\fR]]
18 \fBrunacct\fR is the main daily accounting shell procedure. It is normally
19 initiated using \fBcron\fR. \fBrunacct\fR processes connect, fee, disk, and
20 process accounting files. It also prepares summary files for \fBprdaily\fR or
21 billing purposes. \fBrunacct\fR is distributed only to source code licensees.
24 \fBrunacct\fR takes care not to damage active accounting files or summary files
25 in the event of errors. It records its progress by writing descriptive
26 diagnostic messages into \fBactive\fR. When an error is detected, a message is
27 written to \fB/dev/console\fR, mail (see \fBmail\fR(1)) is sent to \fBroot\fR
28 and \fBadm\fR, and \fBrunacct\fR terminates. \fBrunacct\fR uses a series of
29 lock files to protect against re-invocation. The files \fBlock\fR and
30 \fBlock1\fR are used to prevent simultaneous invocation, and \fBlastdate\fR is
31 used to prevent more than one invocation per day.
34 \fBrunacct\fR breaks its processing into separate, restartable \fIstates\fR
35 using \fBstatefile\fR to remember the last \fIstate\fR completed. It
36 accomplishes this by writing the \fIstate\fR name into \fBstatefile\fR.
37 \fBrunacct\fR then looks in \fBstatefile\fR to see what it has done and to
38 determine what to process next. \fIstates\fR are executed in the following
46 Move active accounting files into working files.
55 Verify integrity of \fBwtmpx\fR file, correcting date changes if necessary.
64 Produce connect session records in \fBtacct.h\fR format.
73 Convert process accounting records into \fBtacct.h\fR format.
82 Merge the connect and process accounting records.
91 Convert output of \fBchargefee\fR into \fBtacct.h\fR format, merge with
92 connect, and process accounting records.
101 Merge disk accounting records with connect, process, and fee accounting
108 \fB\fBMERGETACCT\fR\fR
111 Merge the daily total accounting records in \fBdaytacct\fR with the summary
112 total accounting records in \fB/var/adm/acct/sum/tacct\fR.
121 Produce command summaries.
130 Any installation dependent accounting programs can be included here.
139 Clean up temporary files and exit. To restart \fBrunacct\fR after a failure,
140 first check the \fBactive\fR file for diagnostics, then fix any corrupted data
141 files, such as \fBpacct\fR or \fBwtmpx\fR. The \fBlock\fR, \fBlock1\fR, and
142 \fBlastdate\fR files must be removed before \fBrunacct\fR can be restarted.
143 The argument \fImmdd\fR is necessary if \fBrunacct\fR is being restarted.
144 \fImmdd\fR specifies the month and day for which \fBrunacct\fR will rerun the
145 accounting. The entry point for processing is based on the contents of \fB
146 statefile\fR; to override this, include the desired \fIstate\fR on the command
147 line to designate where processing should begin.
152 \fBExample 1 \fRStarting \fBrunacct\fR
155 The following example starts \fBrunacct\fR:
160 example% nohup runacct 2> /var/adm/acct/nite/fd2log &
166 \fBExample 2 \fRRestarting \fBrunacct\fR
169 The following example restarts \fBrunacct\fR:
174 example% nohup runacct 0601 2>> /var/adm/acct/nite/fd2log &
180 \fBExample 3 \fRRestarting \fBrunacct\fR at a Specific State
183 The following example restarts \fBrunacct\fR at a specific state:
188 example% nohup runacct 0601 MERGE 2>> /var/adm/acct/nite/fd2log &
197 \fB\fB/var/adm/wtmpx\fR\fR
201 History of user access and administration information
207 \fB\fB/var/adm/pacct\fR\fIincr\fR\fR
217 \fB\fB/var/adm/acct/nite/active\fR\fR
227 \fB\fB/var/adm/acct/nite/daytacct\fR\fR
237 \fB\fB/var/adm/acct/nite/lock\fR\fR
247 \fB\fB/var/adm/acct/nite/lock1\fR\fR
257 \fB\fB/var/adm/acct/nite/lastdate\fR\fR
267 \fB\fB/var/adm/acct/nite/statefile\fR\fR
277 \fBacctcom\fR(1), \fBmail\fR(1), \fBacct\fR(1M), \fBacctcms\fR(1M),
278 \fBacctcon\fR(1M), \fBacctmerg\fR(1M), \fBacctprc\fR(1M), \fBacctsh\fR(1M),
279 \fBcron\fR(1M), \fBfwtmp\fR(1M), \fBacct\fR(2), \fBacct.h\fR(3HEAD),
280 \fButmpx\fR(4), \fBattributes\fR(5)
284 It is not recommended to restart \fBrunacct\fR in the \fBSETUP\fR \fIstate\fR.
285 Run \fBSETUP\fR manually and restart using:
288 \fBrunacct\fR \fImmdd\fR \fBWTMPFIX\fR
291 If \fBrunacct\fR failed in the \fBPROCESS\fR \fIstate,\fR remove the last
292 \fBptacct\fR file because it will not be complete.
295 The \fBrunacct\fR command can process a maximum of
300 6000 distinct sessions
306 1000 distinct terminal lines
312 2000 distinct login names
316 during a single invocation of the command. If at some point the actual number
317 of any one of these items exceeds the maximum, the command will not succeed.
320 Do not invoke \fBrunacct\fR at the same time as \fBckpacct\fR, as there may be
321 a conflict if both scripts attempt to execute \fBturnacct switch\fR