3 # $FreeBSD: src/etc/periodic/daily/310.accounting,v 1.3.2.3 2001/06/13 19:36:50 brian Exp $
4 # $DragonFly: src/etc/periodic/daily/310.accounting,v 1.2 2003/06/17 04:24:48 dillon Exp $
7 # If there is a global system configuration file, suck it in.
9 if [ -r /etc/defaults/periodic.conf ]
11 . /etc/defaults/periodic.conf
15 case "$daily_accounting_enable" in
17 if [ ! -f /var/account/acct ]
19 echo '$daily_accounting_enable is set but /var/account/acct' \
22 elif [ -z "$daily_accounting_save" ]
24 echo '$daily_accounting_enable is set but ' \
25 '$daily_accounting_save is not'
29 echo "Rotating accounting logs and gathering statistics:"
34 n=$daily_accounting_save
35 rm -f acct.$n.gz acct.$n || rc=3
40 [ -f acct.$n.gz ] && { mv -f acct.$n.gz acct.$m.gz || rc=3; }
41 [ -f acct.$n ] && { mv -f acct.$n acct.$m || rc=3; }
45 cp -pf acct acct.0 || rc=3
46 sa -s $daily_accounting_flags || rc=3
48 case "$daily_accounting_compress" in
50 gzip -f acct.0 || rc=3;;