summaryrefslogtreecommitdiffstats
path: root/etc/periodic/daily/310.accounting
blob: f713920fe2a33f3a4fc1e3d57f18d09805adc31e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
#
# $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
fi
OpenPOWER on IntegriCloud