6 # If there is a global system configuration file, suck it in.
8 if [ -r /etc/defaults/periodic.conf ]
10 . /etc/defaults/periodic.conf
14 case "$daily_accounting_enable" in
16 if [ ! -f /var/account/acct ]
18 echo '$daily_accounting_enable is set but /var/account/acct' \
21 elif [ -z "$daily_accounting_save" ]
23 echo '$daily_accounting_enable is set but ' \
24 '$daily_accounting_save is not'
28 echo "Rotating accounting logs and gathering statistics:"
33 n=$(( $daily_accounting_save - 1 ))
35 case "$f" in acct.\*) continue ;; esac # No files match
36 m=${f%.gz} ; m=${m#acct.}
37 [ $m -ge $n ] && { rm $f || rc=3; }
44 [ -f acct.$n.gz ] && { mv -f acct.$n.gz acct.$m.gz || rc=3; }
45 [ -f acct.$n ] && { mv -f acct.$n acct.$m || rc=3; }
50 /etc/rc.d/accounting rotate_log || rc=3
52 rm -f acct.merge && cp acct.0 acct.merge || rc=3
53 sa -s $daily_accounting_flags /var/account/acct.merge || rc=3
56 case "$daily_accounting_compress" in
58 gzip -f acct.0 || rc=3;;