diff options
Diffstat (limited to 'etc/periodic/daily/310.accounting')
-rwxr-xr-x | etc/periodic/daily/310.accounting | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/etc/periodic/daily/310.accounting b/etc/periodic/daily/310.accounting index f713920fe2a3..15e5c6de1caa 100755 --- a/etc/periodic/daily/310.accounting +++ b/etc/periodic/daily/310.accounting @@ -3,14 +3,26 @@ # $FreeBSD$ # -if [ -f /var/account/acct ] ; then - echo "" - echo "Rotating accounting logs and gathering statistics:" - - cd /var/account - if [ -f acct.2 ] ; then mv -f acct.2 acct.3 ; fi - if [ -f acct.1 ] ; then mv -f acct.1 acct.2 ; fi - if [ -f acct.0 ] ; then mv -f acct.0 acct.1 ; fi - cp -pf acct acct.0 - sa -s > /dev/null +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs fi + +case "$daily_accounting_enable" in + [Yy][Ee][Ss]) + if [ -f /var/account/acct ] + then + echo "" + echo "Rotating accounting logs and gathering statistics:" + + cd /var/account + [ -f acct.2 ] && mv -f acct.2 acct.3 + [ -f acct.1 ] && mv -f acct.1 acct.2 + [ -f acct.0 ] && mv -f acct.0 acct.1 + cp -pf acct acct.0 + sa -s >/dev/null + fi;; +esac |