#!/bin/sh
#########
# wtmptrim.sh - Trim old entrues off of the wtmp file so it doesn't grow
# forever.
#
# V1.0 - 12/07/00
#
/usr/sbin/acct/fwtmp < /var/adm/wtmp | tail -20000 > /tmp/wtmp.ascii.new
if [ "$?" != 0 ]
then
echo "$0" "Error extracting wtmp file"
exit
fi
/usr/sbin/acct/fwtmp -ic < /tmp/wtmp.ascii.new > /var/adm/wtmp
if [ "$?" != 0 ]
then
echo "$0" "Error recompressing wtmp file"
exit
else
rm /tmp/wtmp.ascii.new
fi