Purging Accting File wtmp
2007-12-25 8:43:00
msolda@lamont.ldgo.columbia.edu
stefan@centaur.astro.utoronto.ca
Eckhard.Rueggeberg@ts.go.dlr.de
mcostel@mach10.utica1.kaman.com
My original question was:
> HELP
>
> How do I purge user accounting file!
>
> How do I purge the wtmp file? It's 5MB and gowing. I can't find anything on
> answerbook or in the man pages on my system.
>
The most popular response was:
cp /dev/null /var/adm/wtmp or cat /dev/null > /var/adm/wtmp
However, this didn't work. When I logged off and logged back on the file was
still there.
Other answers were as follows:
Take a look in the /usr/lib/acct directory for "turnacct" and others.
These are the tools you need to start, stop, and process accounting files.
-_gene
/usr/lib/acct/runacct
unset noclobber
cat > /var/adm/wtmp
^D
is the sequence to cut an open file (by syslog ?) to zero length ...
tail -100 /var/adm/wtmp > /var/adm/wtmp.temp
rm /var/adm/wtmp
mv /var/adm/wtmp.temp /var/adm/wtmp
Rotate or purge /etc/wtmp (or wherever that is linked). If you are
running solaris 2.x you MUST also rotate or purge /etc/wtmpx (or wherever
that is linked). If you do not do wtmpx, wtmp gets recreated from wtmpx.
We do this in a daily cron job.
Thanks to everyone for their help.
--Bill
Comments
Got something to say?
You must be logged in to post a comment.

