Move /var/svc/log to /var/log/svc
[unleashed.git] / share / man / man8 / acctcon.8
blobe2ff79fc93acdc794395c2511058dadb9171764c
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 ACCTCON 8 "Feb 22, 1999"
7 .SH NAME
8 acctcon, acctcon1, acctcon2 \- connect-time accounting
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB/usr/lib/acct/acctcon\fR [\fB-l\fR \fIlineuse\fR] [\fB-o\fR \fIreboot\fR]
13 .fi
15 .LP
16 .nf
17 \fB/usr/lib/acct/acctcon1\fR [\fB-p\fR] [\fB-t\fR] [\fB-l\fR \fIlineuse\fR] [\fB-o\fR \fIreboot\fR]
18 .fi
20 .LP
21 .nf
22 \fB/usr/lib/acct/acctcon2\fR
23 .fi
25 .SH DESCRIPTION
26 .sp
27 .LP
28 \fBacctcon\fR converts a sequence of login/logoff records to total accounting
29 records (see the \fBtacct\fR format in \fBacct.h\fR(3HEAD)). The login/logoff
30 records are read from standard input.  The file \fB/var/log/wtmpx\fR is usually
31 the source of the login/logoff records; however, because it might contain
32 corrupted records or system date changes, it should first be fixed using
33 \fBwtmpfix\fR. The fixed version of file \fB/var/log/wtmpx\fR can then be
34 redirected to \fBacctcon\fR. The \fBtacct\fR records are written to standard
35 output.
36 .sp
37 .LP
38 \fBacctcon\fR is a combination of the programs \fBacctcon1\fR and
39 \fBacctcon2\fR. \fBacctcon1\fR converts login/logoff records, taken from the
40 fixed \fB/var/log/wtmpx\fR file, to ASCII output. \fBacctcon2\fR reads the
41 ASCII records produced by \fBacctcon1\fR and converts them to \fBtacct\fR
42 records. \fBacctcon1\fR can be used with the \fB-l\fR and \fB-o\fR options,
43 described below, as well as with the \fB-p\fR and \fB-t\fR options.
44 .SH OPTIONS
45 .sp
46 .ne 2
47 .na
48 \fB\fB-p\fR\fR
49 .ad
50 .RS 14n
51 Print input only, showing line name, login name, and time (in both numeric and
52 date/time formats).
53 .RE
55 .sp
56 .ne 2
57 .na
58 \fB\fB-t\fR\fR
59 .ad
60 .RS 14n
61 \fBacctcon1\fR maintains a list of lines on which users are logged in. When it
62 reaches the end of its input, it emits a session record for each line that
63 still appears to be active. It normally assumes that its input is a current
64 file, so that it uses the current time as the ending time for each session
65 still in progress. The \fB-t\fR flag causes it to use, instead, the last time
66 found in its input, thus assuring reasonable and repeatable numbers for
67 non-current files.
68 .RE
70 .sp
71 .ne 2
72 .na
73 \fB\fB-l\fR \fIlineuse\fR\fR
74 .ad
75 .RS 14n
76 \fIlineuse\fR is created to contain a summary of line usage showing line name,
77 number of minutes used, percentage of total elapsed time used, number of
78 sessions charged, number of logins, and number of logoffs.  This file helps
79 track line usage, identify bad lines, and find software and hardware oddities.
80 Hangup, termination of \fBlogin\fR(1) and termination of the login shell each
81 generate logoff records, so that the number of logoffs is often three to four
82 times the number of sessions. See \fB init\fR(8) and \fButmpx\fR(4).
83 .RE
85 .sp
86 .ne 2
87 .na
88 \fB\fB-o\fR \fIreboot\fR\fR
89 .ad
90 .RS 14n
91 \fBreboot\fR is filled with an overall record for the accounting period, giving
92 starting time, ending time, number of reboots, and number of date changes.
93 .RE
95 .SH EXAMPLES
96 .LP
97 \fBExample 1 \fRUsing the \fBacctcon\fR command.
98 .sp
99 .LP
100 The \fBacctcon\fR command is typically used as follows:
103 .in +2
105 example% acctcon \fB-l\fR lineuse \fB-o\fR reboots < tmpwtmp > ctacct
107 .in -2
112 The \fBacctcon1\fR and \fBacctcon2\fR commands are typically used as follows:
115 .in +2
117 example% acctcon1 \fB-l\fR lineuse \fB-o\fR reboots < tmpwtmp | sort +1n +2 > ctmp
118 example% acctcon2 < ctmp > ctacct
120 .in -2
123 .SH FILES
125 .ne 2
127 \fB\fB/var/log/wtmpx\fR\fR
129 .RS 18n
130 History of user access and administration information
133 .SH SEE ALSO
136 \fBacctcom\fR(1), \fBlogin\fR(1), \fBacct\fR(8), \fBacctcms\fR(8),
137 \fBacctmerg\fR(8), \fBacctprc\fR(8), \fBacctsh\fR(8), \fBfwtmp\fR(8),
138 \fBinit\fR(8), \fBrunacct\fR(8), \fBacct\fR(2), \fBacct.h\fR(3HEAD),
139 \fButmpx\fR(4), \fBattributes\fR(5)
142 \fI\fR
143 .SH NOTES
146 The line usage report is confused by date changes. Use \fBwtmpfix\fR (see
147 \fBfwtmp\fR(8)), with the \fB/var/log/wtmpx\fR file as an argument, to correct
148 this situation.
151 During a single invocation of any given command, the \fBacctcon\fR,
152 \fBacctcon1\fR, and \fBacctcon2\fR commands can process a maximum of:
153 .RS +4
155 .ie t \(bu
156 .el o
157 6000 distinct session
159 .RS +4
161 .ie t \(bu
162 .el o
163 1000 distinct terminal lines
165 .RS +4
167 .ie t \(bu
168 .el o
169 2000 distinct login names
173 If at some point the actual  number of any one of these items exceeds the
174 maximum, the command will not succeed.