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

NAME

6       acct,  acctdisk,  acctdusg,  accton,  acctwtmp,  closewtmp, utmp2wtmp -
7       overview of accounting and miscellaneous accounting commands
8

SYNOPSIS

10       /usr/lib/acct/acctdisk
11
12
13       /usr/lib/acct/acctdusg [-u filename] [-p filename]
14
15
16       /usr/lib/acct/accton [filename]
17
18
19       /usr/lib/acct/acctwtmp reason filename
20
21
22       /usr/lib/acct/closewtmp
23
24
25       /usr/lib/acct/utmp2wtmp
26
27

DESCRIPTION

29       Accounting software is structured as a set of tools (consisting of both
30       C  programs  and shell procedures) that can be used to build accounting
31       systems. acctsh(1M) describes the set of shell procedures built on  top
32       of the C programs.
33
34
35       Connect  time  accounting  is  handled  by  various programs that write
36       records into /var/adm/wtmpx, as described  in  utmpx(4).  The  programs
37       described  in  acctcon(1M)  convert this file into session and charging
38       records, which are then summarized by acctmerg(1M).
39
40
41       Process accounting is performed by the system kernel. Upon  termination
42       of  a  process,  one  record per process is written to a file (normally
43       /var/adm/pacct). The programs in acctprc(1M) summarize  this  data  for
44       charging purposes; acctcms(1M) is used to summarize command usage. Cur‐
45       rent process data may be examined using acctcom(1).
46
47
48       Process accounting records and connect time accounting records (or  any
49       accounting  records in the tacct format described in acct.h(3HEAD)) can
50       be merged and summarized into total accounting records by acctmerg (see
51       tacct  format  in  acct.h(3HEAD)).  prtacct (see acctsh(1M)) is used to
52       format any or all accounting records.
53
54
55       acctdisk reads lines that contain user ID, login name,  and  number  of
56       disk  blocks  and converts them to total accounting records that can be
57       merged with other accounting records. acctdisk returns an error if  the
58       input file is corrupt or improperly formatted.
59
60
61       acctdusg reads its standard input (usually from find / -print) and com‐
62       putes disk resource consumption (including indirect blocks) by login.
63
64
65       accton without arguments turns process accounting off. If  filename  is
66       given,  it  must  be  the name of an existing file, to which the kernel
67       appends process accounting records (see acct(2) and acct.h(3HEAD)).
68
69
70       acctwtmp writes a utmpx(4) record to filename. The record contains  the
71       current  time  and  a  string of characters that describe the reason. A
72       record type of ACCOUNTING is assigned (see utmpx(4)) reason must  be  a
73       string  of  11 or fewer characters, numbers, $, or spaces. For example,
74       the following are suggestions for use in  reboot  and  shutdown  proce‐
75       dures, respectively:
76
77         acctwtmp "acctg on" /var/adm/wtmpx
78         acctwtmp "acctg off" /var/adm/wtmpx
79
80
81
82       For  each user currently logged on, closewtmp puts a false DEAD_PROCESS
83       record in the /var/adm/wtmpx file. runacct (see runacct(1M)) uses  this
84       false DEAD_PROCESS record so that the connect accounting procedures can
85       track the time used by users logged on before runacct was invoked.
86
87
88       For each user currently logged on, runacct uses utmp2wtmp to create  an
89       entry  in  the  file  /var/adm/wtmpx,  created  by  runacct. Entries in
90       /var/adm/wtmpx enable subsequent invocations of runacct to account  for
91       connect times of users currently logged in.
92

OPTIONS

94       The following options are supported:
95
96       -u filename    Places in filename records consisting of those filenames
97                      for which acctdusg charges no one  (a  potential  source
98                      for finding users trying to avoid disk charges).
99
100
101       -p filename    Specifies  a password file, filename. This option is not
102                      needed if the password file is /etc/passwd.
103
104

ENVIRONMENT VARIABLES

106       If any of the LC_* variables (LC_TYPE,  LC_MESSAGES,  LC_TIME,  LC_COL‐
107       LATE,  LC_NUMERIC, and LC_MONETARY) (see environ(5)) are not set in the
108       environment, the operational behavior of acct  for  each  corresponding
109       locale  category  is  determined  by  the value of the LANG environment
110       variable. If LC_ALL is set, its contents are used to override both  the
111       LANG  and  the other LC_* variables. If none of the above variables are
112       set in the environment, the "C" (U.S. style) locale determines how acct
113       behaves.
114
115       LC_CTYPE    Determines  how  acct  handles characters. When LC_CTYPE is
116                   set to a valid value, acct can display and handle text  and
117                   filenames containing valid characters for that locale. acct
118                   can display and handle Extended Unix Code (EUC)  characters
119                   where any  character can be 1, 2, or 3 bytes wide. acct can
120                   also handle EUC characters of 1, 2, or more column  widths.
121                   In  the  "C"  locale,  only  characters from ISO 8859-1 are
122                   valid.
123
124
125       LC_TIME     Determines how acct handles date and time formats.  In  the
126                   "C" locale, date and time handling follows the U.S. rules.
127
128

FILES

130       /etc/passwd       Used for login name to user ID conversions.
131
132
133       /usr/lib/acct     Holds  all accounting commands listed in sub-class 1M
134                         of this manual.
135
136
137       /var/adm/pacct    Current process accounting file.
138
139
140       /var/adm/wtmpx    History of user access  and  administration  informa‐
141                         tion..
142
143

ATTRIBUTES

145       See attributes(5) for descriptions of the following attributes:
146
147
148
149
150       ┌─────────────────────────────┬─────────────────────────────┐
151       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
152       ├─────────────────────────────┼─────────────────────────────┤
153       │Availability                 │SUNWaccu                     │
154       └─────────────────────────────┴─────────────────────────────┘
155

SEE ALSO

157       acctcom(1),   acctcms(1M),   acctcon(1M),   acctmerg(1M),  acctprc(1M),
158       acctsh(1M), fwtmp(1M), runacct(1M), acct(2), acct.h(3HEAD),  passwd(4),
159       utmpx(4), attributes(5), environ(5)
160
161
162
163
164
165
166SunOS 5.11                        22 Feb 1999                         acct(1M)
Impressum