I'm looking for a way to clear my wtmp file. (The wtmp file records
all logins and logouts.)
Can you please let me know the command to use, or if it is simply
a matter of deleting and recreating the file with 0 bytes.
Thank you in advance
Ayoub Raffoul
pad...@pipsc.ca
Hi there.
#cat /dev/null > wtmp
should do the job.
cheers
--Luk
I have no idea if you have a huge /etc/wtmp file as you did'nt say but if
not and you are just doing a bit of housekeeping then you should'nt worry.
The /etc/wtmp file is re-created at boot time (purged) and setup ready to
recieve new entries for the days accounting.
Below I have included an extract from our online manual pages which may be
of use :-
Motorola 88100 Unix R32V3.1
man shutacct
shutacct is invoked during a system shutdown to turn process
accounting off and append a reason record to /etc/wtmp. The
reason is limited to 11 characters.
startup can be called to turn the accounting on when the
system is brought to a multi-user state.
man turnacct
turnacct is an interface to accton (see acct(1M)) to turn
process accounting on or off. The switch argument turns
accounting off, moves the current /usr/adm/pacct to the next
free name in /usr/adm/pacctincr (where incr is a number
starting with 1 and incrementing by one for each additional
pacct file), then turns accounting back on again. This
procedure is called by ckpacct and thus can be taken care of
by cron and used to keep pacct to a reasonable size. acct
starts and stops process accounting via init and shutdown
--
Richard Warburton
Technical Manager
Ayoub Raffoul <pad...@pipsc.ca> wrote in article
<326BA0...@pipsc.ca>...
> Hello
>
Execute the following command:
cat /dev/null>/etc/wtmp (assuming your wtmp is in /etc).
--
Jeff Goldstein
Eaton Corporation
jgol...@vines.etn.com
"186,000 miles per second. It's not just a good idea. It's the law."
: I have no idea if you have a huge /etc/wtmp file as you did'nt say but if
: not and you are just doing a bit of housekeeping then you should'nt worry.
: The /etc/wtmp file is re-created at boot time (purged) and setup ready to
: recieve new entries for the days accounting.
I just run a cron entry to remove the file and replace an empty with "touch".
Should do this maybe once a week or so, depending on how heavy the load is.
Of course, it's a good idea to make a backup of it for review if needed...
--
------------------------------------------------
THINK FREE! | mi...@ripco.com
Knowledge is Power! | question everything!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~