5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License, Version 1.0 only
7 # (the "License"). You may not use this file except in compliance
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or http://www.opensolaris.org/os/licensing.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
15 # When distributing Covered Code, include this CDDL HEADER in each
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 # If applicable, add the following below this CDDL HEADER, with the
18 # fields enclosed by brackets "[]" replaced with your own identifying
19 # information: Portions Copyright [yyyy] [name of copyright owner]
23 # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
27 # Copyright 1992 Sun Microsystems, Inc. All rights reserved.
28 # Use is subject to license terms.
31 #ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.12 */
32 # "prdaily prints daily report"
33 # "last command executed in runacct"
34 # "if given a date mmdd, will print that report"
35 PATH
=/usr
/lib
/acct
:/usr
/bin
:/usr
/sbin
42 ?
) echo Usage
: prdaily
[-c] [-l] [mmdd
] >&2
46 shift `expr $OPTIND - 1`
49 _nite
=/var
/adm
/acct
/nite
51 _sum
=/var
/adm
/acct
/sum
54 if [ `expr "$1" : [01][0-9][0-3][0-9]` -eq 4 -a "$1" != "$date" ]; then
55 if [ "$CMDEXCPT" = "1" ]
57 echo "Cannot print command exception reports except for `date '+%h %d'`" >&2
60 if [ "$LINEEXCPT" = "1" ]
62 acctmerg
-a < ${_sum}/tacct
$1 |
awk -f ${_lib}/ptelus.
awk
69 if [ "$CMDEXCPT" = 1 ]
71 acctcms
-a -s ${_sum}/daycms |
awk -f ${_lib}/ptecms.
awk
73 if [ "$LINEEXCPT" = 1 ]
75 acctmerg
-a < ${_sum}/tacct${date} | awk -f ${_lib}/ptelus.
awk
77 if [ "$CMDEXCPT" = 1 -o "$LINEEXCPT" = 1 ]
81 (cat reboots
; echo ""; cat lineuse
) |
pr -h "DAILY REPORT FOR ${_sysname}"
83 prtacct daytacct
"DAILY USAGE REPORT FOR ${_sysname}"
84 pr -h "DAILY COMMAND SUMMARY" daycms
85 pr -h "MONTHLY TOTAL COMMAND SUMMARY" cms
86 pr -h "LAST LOGIN" -3 ..
/sum
/loginlog