Move everything from /var/adm to /var/log
[unleashed/lotheac.git] / share / man / man8 / runacct.8
blob8cd48983e19c74a2741e1eb48e8e45426c5b6bd8
1 '\" te
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 8 "May 11, 1999"
7 .SH NAME
8 runacct \- run daily accounting
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB/usr/lib/acct/runacct\fR [\fImmdd\fR [\fIstate\fR]]
13 .fi
15 .SH DESCRIPTION
16 .sp
17 .LP
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.
22 .sp
23 .LP
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.
32 .sp
33 .LP
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
39 order:
40 .sp
41 .ne 2
42 .na
43 \fB\fBSETUP\fR\fR
44 .ad
45 .RS 14n
46 Move active accounting files into working files.
47 .RE
49 .sp
50 .ne 2
51 .na
52 \fB\fBWTMPFIX\fR\fR
53 .ad
54 .RS 14n
55 Verify integrity of \fBwtmpx\fR file, correcting date changes if necessary.
56 .RE
58 .sp
59 .ne 2
60 .na
61 \fB\fBCONNECT\fR\fR
62 .ad
63 .RS 14n
64 Produce connect session records in \fBtacct.h\fR format.
65 .RE
67 .sp
68 .ne 2
69 .na
70 \fB\fBPROCESS\fR\fR
71 .ad
72 .RS 14n
73 Convert process accounting records into \fBtacct.h\fR format.
74 .RE
76 .sp
77 .ne 2
78 .na
79 \fB\fBMERGE\fR\fR
80 .ad
81 .RS 14n
82 Merge the connect and process accounting records.
83 .RE
85 .sp
86 .ne 2
87 .na
88 \fB\fBFEES\fR\fR
89 .ad
90 .RS 14n
91 Convert output of \fBchargefee\fR into \fBtacct.h\fR format, merge with
92 connect, and process accounting records.
93 .RE
95 .sp
96 .ne 2
97 .na
98 \fB\fBDISK\fR\fR
99 .ad
100 .RS 14n
101 Merge disk accounting records with connect, process, and fee accounting
102 records.
106 .ne 2
108 \fB\fBMERGETACCT\fR\fR
110 .RS 14n
111 Merge the daily total accounting records in \fBdaytacct\fR with the summary
112 total accounting records in \fB/var/log/acct/sum/tacct\fR.
116 .ne 2
118 \fB\fBCMS\fR\fR
120 .RS 14n
121 Produce command summaries.
125 .ne 2
127 \fB\fBUSEREXIT\fR\fR
129 .RS 14n
130 Any installation dependent accounting programs can be included here.
134 .ne 2
136 \fB\fBCLEANUP\fR\fR
138 .RS 14n
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.
150 .SH EXAMPLES
152 \fBExample 1 \fRStarting \fBrunacct\fR
155 The following example starts \fBrunacct\fR:
158 .in +2
160 example% nohup runacct 2> /var/log/acct/nite/fd2log &
162 .in -2
166 \fBExample 2 \fRRestarting \fBrunacct\fR
169 The following example restarts \fBrunacct\fR:
172 .in +2
174 example% nohup runacct 0601 2>> /var/log/acct/nite/fd2log &
176 .in -2
180 \fBExample 3 \fRRestarting \fBrunacct\fR at a Specific State
183 The following example restarts \fBrunacct\fR at a specific state:
186 .in +2
188 example% nohup runacct 0601 MERGE 2>> /var/log/acct/nite/fd2log &
190 .in -2
193 .SH FILES
195 .ne 2
197 \fB\fB/var/log/wtmpx\fR\fR
199 .sp .6
200 .RS 4n
201 History of user access and administration information
205 .ne 2
207 \fB\fB/var/log/pacct\fR\fIincr\fR\fR
209 .sp .6
210 .RS 4n
215 .ne 2
217 \fB\fB/var/log/acct/nite/active\fR\fR
219 .sp .6
220 .RS 4n
225 .ne 2
227 \fB\fB/var/log/acct/nite/daytacct\fR\fR
229 .sp .6
230 .RS 4n
235 .ne 2
237 \fB\fB/var/log/acct/nite/lock\fR\fR
239 .sp .6
240 .RS 4n
245 .ne 2
247 \fB\fB/var/log/acct/nite/lock1\fR\fR
249 .sp .6
250 .RS 4n
255 .ne 2
257 \fB\fB/var/log/acct/nite/lastdate\fR\fR
259 .sp .6
260 .RS 4n
265 .ne 2
267 \fB\fB/var/log/acct/nite/statefile\fR\fR
269 .sp .6
270 .RS 4n
274 .SH SEE ALSO
277 \fBacctcom\fR(1), \fBmail\fR(1), \fBacct\fR(8), \fBacctcms\fR(8),
278 \fBacctcon\fR(8), \fBacctmerg\fR(8), \fBacctprc\fR(8), \fBacctsh\fR(8),
279 \fBcron\fR(8), \fBfwtmp\fR(8), \fBacct\fR(2), \fBacct.h\fR(3HEAD),
280 \fButmpx\fR(4), \fBattributes\fR(5)
281 .SH NOTES
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
296 .RS +4
298 .ie t \(bu
299 .el o
300 6000 distinct sessions
302 .RS +4
304 .ie t \(bu
305 .el o
306 1000 distinct terminal lines
308 .RS +4
310 .ie t \(bu
311 .el o
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
322 simultaneously.