1runacct(1M) System Administration Commands runacct(1M)
2
3
4
6 runacct - run daily accounting
7
9 /usr/lib/acct/runacct [mmdd [state]]
10
11
13 runacct is the main daily accounting shell procedure. It is normally
14 initiated using cron. runacct processes connect, fee, disk, and
15 process accounting files. It also prepares summary files for prdaily or
16 billing purposes. runacct is distributed only to source code licensees.
17
18
19 runacct takes care not to damage active accounting files or summary
20 files in the event of errors. It records its progress by writing
21 descriptive diagnostic messages into active. When an error is detected,
22 a message is written to /dev/console, mail (see mail(1)) is sent to
23 root and adm, and runacct terminates. runacct uses a series of lock
24 files to protect against re-invocation. The files lock and lock1 are
25 used to prevent simultaneous invocation, and lastdate is used to pre‐
26 vent more than one invocation per day.
27
28
29 runacct breaks its processing into separate, restartable states using
30 statefile to remember the last state completed. It accomplishes this by
31 writing the state name into statefile. runacct then looks in statefile
32 to see what it has done and to determine what to process next. states
33 are executed in the following order:
34
35 SETUP Move active accounting files into working files.
36
37
38 WTMPFIX Verify integrity of wtmpx file, correcting date changes
39 if necessary.
40
41
42 CONNECT Produce connect session records in tacct.h format.
43
44
45 PROCESS Convert process accounting records into tacct.h format.
46
47
48 MERGE Merge the connect and process accounting records.
49
50
51 FEES Convert output of chargefee into tacct.h format, merge
52 with connect, and process accounting records.
53
54
55 DISK Merge disk accounting records with connect, process, and
56 fee accounting records.
57
58
59 MERGETACCT Merge the daily total accounting records in daytacct with
60 the summary total accounting records in
61 /var/adm/acct/sum/tacct.
62
63
64 CMS Produce command summaries.
65
66
67 USEREXIT Any installation dependent accounting programs can be
68 included here.
69
70
71 CLEANUP Clean up temporary files and exit. To restart runacct
72 after a failure, first check the active file for diag‐
73 nostics, then fix any corrupted data files, such as pacct
74 or wtmpx. The lock, lock1, and lastdate files must be
75 removed before runacct can be restarted. The argument
76 mmdd is necessary if runacct is being restarted. mmdd
77 specifies the month and day for which runacct will rerun
78 the accounting. The entry point for processing is based
79 on the contents of statefile; to override this, include
80 the desired state on the command line to designate where
81 processing should begin.
82
83
85 Example 1 Starting runacct
86
87
88 The following example starts runacct:
89
90
91 example% nohup runacct 2> /var/adm/acct/nite/fd2log &
92
93
94
95 Example 2 Restarting runacct
96
97
98 The following example restarts runacct:
99
100
101 example% nohup runacct 0601 2>> /var/adm/acct/nite/fd2log &
102
103
104
105 Example 3 Restarting runacct at a Specific State
106
107
108 The following example restarts runacct at a specific state:
109
110
111 example% nohup runacct 0601 MERGE 2>> /var/adm/acct/nite/fd2log &
112
113
114
116 /var/adm/wtmpx
117
118 History of user access and administration information
119
120
121 /var/adm/pacctincr
122
123
124
125
126 /var/adm/acct/nite/active
127
128
129
130
131 /var/adm/acct/nite/daytacct
132
133
134
135
136 /var/adm/acct/nite/lock
137
138
139
140
141 /var/adm/acct/nite/lock1
142
143
144
145
146 /var/adm/acct/nite/lastdate
147
148
149
150
151 /var/adm/acct/nite/statefile
152
153
154
155
157 See attributes(5) for descriptions of the following attributes:
158
159
160
161
162 ┌─────────────────────────────┬─────────────────────────────┐
163 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
164 ├─────────────────────────────┼─────────────────────────────┤
165 │Availability │SUNWaccu │
166 └─────────────────────────────┴─────────────────────────────┘
167
169 acctcom(1), mail(1), acct(1M), acctcms(1M), acctcon(1M), acctmerg(1M),
170 acctprc(1M), acctsh(1M), cron(1M), fwtmp(1M), acct(2), acct.h(3HEAD),
171 utmpx(4), attributes(5)
172
174 It is not recommended to restart runacct in the SETUP state. Run SETUP
175 manually and restart using:
176
177
178 runacct mmdd WTMPFIX
179
180
181 If runacct failed in the PROCESS state, remove the last ptacct file
182 because it will not be complete.
183
184
185 The runacct command can process a maximum of
186
187 o 6000 distinct sessions
188
189 o 1000 distinct terminal lines
190
191 o 2000 distinct login names
192
193
194 during a single invocation of the command. If at some point the actual
195 number of any one of these items exceeds the maximum, the command will
196 not succeed.
197
198
199 Do not invoke runacct at the same time as ckpacct, as there may be a
200 conflict if both scripts attempt to execute turnacct switch simultane‐
201 ously.
202
203
204
205SunOS 5.11 11 May 1999 runacct(1M)