SUMMARY: Purging Accting File wtmp

From: Bill Murray (71213.2657@CompuServe.COM)
Date: Wed Mar 23 1994 - 11:57:29 CST

Thanks to everyone for the responses!

My original question was:

> 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.


unset noclobber
cat > /var/adm/wtmp

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.


This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:58 CDT