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]
24 # Copyright 2004 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
28 # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
32 #ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.13 */
33 # 'perform disk accounting'
34 PATH
=:/usr
/lib
/acct
:/usr
/bin
:/usr
/sbin
36 if [ -f /usr
/bin
/uts
-a /usr
/bin
/uts
]
38 format
="dev mnt type comment"
40 format
="special dev mnt fstype fsckpass automnt mntflags"
47 echo "Usage: $0 [ -o ] [ filesystem ... ]" >&2
63 if [ -f /usr
/bin
/uts
-a /usr
/bin
/uts
]
65 DEVLIST
=/etc
/checklist
76 elif [ `expr $special : '\(.\)'` = \
# ]
80 if [ "$fsckpass" = "-" ]
84 if [ $fstype != ufs
] && [ $fstype != vxfs
]
89 # Make sure FS is mounted
90 if egrep -s "^${special}[ ]+${mnt}[ ]" /etc
/mnttab
92 find $mnt -mount -print | \
94 `echo $dev | sed s-/-_-g`.dtmp
&
101 if [ "`echo *.dtmp`" != "*.dtmp" ]
104 {tot[$1] += $3; if (name[$1] == "") name[$1] = "" $2}
105 END {for (i in tot) printf "%d\t%s\t%d\n", i, name[i], tot[i]}' *.dtmp
> dtmp
111 find $
* -mount -print | acctdusg
> dtmp
123 echo "$0: $i is not a directory -- ignored" >&2
130 echo "$0: No data" >&2
133 find $dir -print | acctdusg
> dtmp
137 sort +0n
+1 dtmp | acctdisk
> ${_pickup}/disktacct
138 chmod 644 ${_pickup}/disktacct
139 chown adm
${_pickup}/disktacct