freebsd_amp_hwpstate/etc/periodic/monthly/200.accounting

24 lines
335 B
Bash
Executable File

#!/bin/sh -
#
# $Id: 200.accounting,v 1.1.1.1 1997/08/16 17:04:01 pst Exp $
#
W=/var/log/wtmp
if [ -f $W ] ; then
# Work out last month's name
M=`date -v-1m +%h`
mv -f $W $W.$M
touch $W
if [ -x /usr/sbin/ac ] ; then
echo ""
echo "Doing login accounting:"
ac -p -w $W.$M | sort -nr +1
fi
rm -f $W.$M.gz
gzip $W.$M
fi