1acctsh(1M)              System Administration Commands              acctsh(1M)
2
3
4

NAME

6       acctsh,   chargefee,  ckpacct,  dodisk,  lastlogin,  monacct,  nulladm,
7       prctmp, prdaily, prtacct, shutacct, startup, turnacct  -  shell  proce‐
8       dures for accounting
9

SYNOPSIS

11       /usr/lib/acct/chargefee login-name number
12
13
14       /usr/lib/acct/ckpacct [blocks]
15
16
17       /usr/lib/acct/dodisk [-o] [filename]...
18
19
20       /usr/lib/acct/lastlogin
21
22
23       /usr/lib/acct/monacct number
24
25
26       /usr/lib/acct/nulladm filename...
27
28
29       /usr/lib/acct/prctmp filename
30
31
32       /usr/lib/acct/prdaily [-c] [-l] [mmdd]
33
34
35       /usr/lib/acct/prtacct filename ['' heading '']
36
37
38       /usr/lib/acct/shutacct ['' reason '']
39
40
41       /usr/lib/acct/startup
42
43
44       /usr/lib/acct/turnacct on | off | switch
45
46

DESCRIPTION

48   chargefee Command
49       chargefee  can  be invoked to charge a number of units to login-name. A
50       record is written to /var/adm/fee, to be merged with  other  accounting
51       records by runacct(1M).
52
53   ckpacct Command
54       ckpacct  should  be  initiated using cron(1M) to periodically check the
55       size of /var/adm/pacct. If the size exceeds  blocks,  500  by  default,
56       turnacct will be invoked with argument switch. To avoid a conflict with
57       turnacct switch execution in runacct, do not run  ckpacct  and  runacct
58       simultaneously. If the number of free disk blocks in the /var file sys‐
59       tem falls below  500, ckpacct will automatically turn off  the  collec‐
60       tion  of  process  accounting records via the off argument to turnacct.
61       When at least  500 blocks are restored,  the accounting will  be  acti‐
62       vated  again  on the next invocation of ckpacct. This feature is sensi‐
63       tive to the frequency at which ckpacct  is  executed,  usually  by  the
64       cron(1M) command.
65
66   dodisk Command
67       dodisk  should  be  invoked  by cron(1M) to perform the disk accounting
68       functions.
69
70   lastlogin Command
71       lastlogin is invoked by runacct(1M) to update  /var/adm/acct/sum/login‐
72       log, which shows the last date on which each person logged in.
73
74   monacct Command
75       monacct  should  be  invoked once each month or each accounting period.
76       number indicates which month or period it is. If number is  not  given,
77       it  defaults  to  the  current month (01−12). This default is useful if
78       monacct is to executed using cron(1M) on the first day of  each  month.
79       monacct  creates summary files in /var/adm/acct/fiscal and restarts the
80       summary files in /var/adm/acct/sum.
81
82   nulladm Command
83       nulladm creates filename with mode 664 and ensures that owner and group
84       are adm. It is called by various accounting shell procedures.
85
86   prctmp Command
87       prctmp  can  be  used  to  print  the  session  record  file  (normally
88       /var/adm/acct/nite/ctmp created by acctcon1 (see acctcon(1M)).
89
90   prdaily Command
91       prdaily is invoked by runacct(1M) to format a report  of  the  previous
92       day's      accounting      data.      The     report     resides     in
93       /var/adm/acct/sum/rprt/mmdd where mmdd is the  month  and  day  of  the
94       report.  The  current daily accounting reports may be printed by typing
95       prdaily. Previous days' accounting reports can be printed by using  the
96       mmdd option and specifying the exact report date desired.
97
98   prtacct Command
99       prtacct   can  be  used  to  format  and  print  any  total  accounting
100       (tacct)file.
101
102   shutacct Command
103       shutacct is invoked during a system shutdown to turn process accounting
104       off and append a  reason record to /var/adm/wtmpx.
105
106   startup Command
107       startup can be invoked when the system is brought to a multi-user state
108       to turn process accounting on.
109
110   turnacct Command
111       turnacct is an interface to  accton  (see  acct(1M))  to  turn  process
112       accounting   on   or   off.  The  switch  argument  moves  the  current
113       /var/adm/pacct to the next free name in /var/adm/pacct.incr (where incr
114       is  a  number  starting  with 0 and incrementing by one  for each addi‐
115       tional pacct file), then turns accounting back on again. This procedure
116       is called by ckpacct and thus can be taken care of by the cron(1M) com‐
117       mand and used to keep  pacct to a reasonable size.   shutacct uses tur‐
118       nacct  to  stop  process  accounting.    startup uses turnacct to start
119       process accounting.
120

OPTIONS

122       The following options are supported:
123
124       -c    This option prints a report of exceptional resource usage by com‐
125             mand, and may be used on current day's accounting data only.
126
127
128       -l    This  option prints a report of exceptional usage by login id for
129             the specified date. Previous daily reports  are  cleaned  up  and
130             therefore inaccessible after each invocation of monacct.
131
132
133       -o    This  option  uses acctdusg (see acct(1M)) to do a slower version
134             of disk accounting by login directory.  filenames  specifies  the
135             one  or more filesystem names where disk accounting will be done.
136             If filenames are used, disk accounting  will  be  done  on  these
137             filesystems  only.  If the -o option is used, filenames should be
138             mount points of mounted filesystems. If the -o option is omitted,
139             filenames  should be the special file names of mountable filesys‐
140             tems.
141
142

FILES

144       /etc/logadm.conf              Configuration  file  for  the  logadm(1M)
145                                     command
146
147
148       /usr/lib/acct                 Holds  all  accounting commands listed in
149                                     section 1M of this manual
150
151
152       /usr/lib/acct/ptecms.awk      Contains the limits for exceptional usage
153                                     by command name
154
155
156       /usr/lib/acct/ptelus.awk      Contains the limits for exceptional usage
157                                     by login ID
158
159
160       /var/adm/acct/fiscal          Fiscal reports directory
161
162
163       /var/adm/acct/nite            Working directory
164
165
166       /var/adm/acct/sum             Summary directory that contains  informa‐
167                                     tion for monacct
168
169
170       /var/adm/acct/sum/loginlog    File updated by last login
171
172
173       /var/adm/fee                  Accumulator for fees
174
175
176       /var/adm/pacct                Current file for per-process accounting
177
178
179       /var/adm/pacctincr            Used  if pacct gets large and during exe‐
180                                     cution of daily accounting procedure
181
182
183       /var/adm/wtmpx                History of user access and administration
184                                     information
185
186

ATTRIBUTES

188       See attributes(5) for descriptions of the following attributes:
189
190
191
192
193       ┌─────────────────────────────┬─────────────────────────────┐
194       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
195       ├─────────────────────────────┼─────────────────────────────┤
196       │Availability                 │SUNWaccu                     │
197       └─────────────────────────────┴─────────────────────────────┘
198

SEE ALSO

200       acctcom(1),  acct(1M),  acctcms(1M),  acctcon(1M),  acctmerg(1M), acct‐
201       prc(1M),  cron(1M),  fwtmp(1M),   logadm(1M),   runacct(1M),   acct(2),
202       acct.h(3HEAD), utmpx(4), attributes(5)
203

NOTES

205       See  runacct(1M) for the main daily accounting shell script, which per‐
206       forms the accumulation of connect, process, fee, and disk accounting on
207       a daily basis. It also creates summaries of command usage.
208
209
210
211SunOS 5.11                        15 Mar 2002                       acctsh(1M)
Impressum