SysIII/usr/src/man/man1/acct.1m
.if t .ds ' \h@.05m@\s+4\v@.333m@\'\v@-.3m@\s-4\h@.05m@
.if n .ds ' '
.if t .ds ` \h@.05m@\s+4\v@.333m@\`\v@-.3m@\s-4\h@.05m@
.if n .ds ` `
.TH ACCT 1M
.SH NAME
acct \- overview of accounting and miscellaneous accounting commands
.SH SYNOPSIS
.B acctdisk
.PP
.B acctdusg
[
.B \-u
file ] [
.B \-p
file ]
.B > dtmp-file
.PP
.B accton
[\^file\^]
.PP
.B acctwtmp
[\^name\^[\^line\^]\^]
.B >>/usr/adm/wtmp
.SH DESCRIPTION
Accounting software is structured as a set of tools
(consisting of both C programs and shell procedures)
that can be used
to build accounting systems.
.IR Acctsh (1M)
describes the set of shell procedures built on top of
the C programs.
.PP
Connect time accounting is handled by various programs that write
records into
.BR /usr/adm/utmp ,
as described in
.IR utmp (5).
The programs described in
.IR acctcon (1M)
convert this file into session and charging records,
which are then summarized by
.IR acctmerg (1M).
.PP
Process accounting is performed by the
.SM UNIX
kernel.
Upon termination of a process,
one record per process is written to a file
(normally
.BR /usr/adm/pacct ).
The programs in
.IR acctprc (1M)
summarize this data for charging purposes;
.IR acctcms (1M)
is used to summarize command usage.
Current process data may be examined using
.IR acctcom (1).
.PP
Process accounting and connect time accounting (or any accounting records
in the format described in
.IR acct (5))
can be merged and summarized into total accounting records by
.I acctmerg\^
(see \fBtacct\fP format in
.IR acct (5)).
.I Prtacct\^
(see
.IR acctsh (1M))
is used to format any or all accounting records.
.PP
.I Acctdisk\^
reads lines that contain user
.SM ID\*S,
login name, and number of
disk blocks and converts them to total accounting
records that can be merged with other accounting records.
.PP
.I Acctdusg\^
reads its standard input (usually from
.BR "find / \-print" )
and computes disk resource consumption
(including indirect blocks) by login.
If \fB\-u\fP is given, records consisting of those file names for which
.I acctdusg\^
charges no one are placed in
.I file\^
(a potential source for finding users trying to avoid disk charges).
If \fB\-p\fP is given,
.I file\^
is the name of the password file.
This option is not needed if the password file is
.BR /etc/passwd .
.PP
.I Accton\^
alone turns process accounting off.
If
.I file\^
is given,
it must be the name of an existing file,
to which the kernel appends process accounting records
(see
.IR acct (2)
and
.IR acct (5)).
.PP
.I Acctwtmp\^
writes a
.IR wtmp (5)
record to its standard output.
The record contains the current time,
.IR name ,
and
.IR line .
If
.I line\^
is omitted,
a value is emitted that is interpreted by other programs as a reboot.
For more precise accounting, the following are recommended
for use in reboot and shutdown procedures, respectively:
.PP
.RS
acctwtmp \|\*`uname\*` \|>>/usr/adm/wtmp
.br
acctwtmp \|reason \|>>/usr/adm/wtmp
.RE
.SH FILES
.ta \w'/usr/adm/wtmp\ \ \ \ 'u +.5i
.nf
/etc/passwd used for login name to user \s-1ID\s+1 conversions
/usr/lib/acct holds all accounting commands listed in
sub-class 1M of this manual
/usr/adm/pacct current process accounting file
/usr/adm/wtmp login/logoff history file
.fi
.SH SEE ALSO
acctcms(1M),
acctcom(1),
acctcon(1M),
acctmerg(1M),
acctprc(1M),
acctsh(1M),
fwtmp(1M),
runacct(1M),
acct(2),
acct(5),
utmp(5).
.br
.I "The \s-1UNIX\s+1 Accounting System\^"
by H. S. McCreary.
.DT