8e525b0803
Reviewed by: Alex Nash, Steve Price Enhance wtmp monthly handling
24 lines
335 B
Bash
Executable File
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
|