Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WTMP FILE

0 views
Skip to first unread message

Ayoub Raffoul

unread,
Oct 21, 1996, 3:00:00 AM10/21/96
to

Hello

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

John Siegstad

unread,
Oct 21, 1996, 3:00:00 AM10/21/96
to pad...@pipsc.ca

Ayoub Raffoul wrote:
>
> Hello
>
> I'm looking for a way to clear my wtmp file.

Hi there.

#cat /dev/null > wtmp

should do the job.

cheers
--Luk

Richard Warbuton

unread,
Oct 23, 1996, 3:00:00 AM10/23/96
to

I had a similar problem where by the /etc/wtmp was growing at such an
alarming rate it was filling the root file system. I finally got to the
bottom of the problem with the help of a util written by our software house
ages ago to display the contents of the /etc/wtmp file. In the file i found
a TSU tty repeatedly logging on (Four times a second) and to cut a long
story short traced it to an incorrectly terminated 'D' type on an r232
cable.

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
>

Jeff Goldstein

unread,
Oct 23, 1996, 3:00:00 AM10/23/96
to

Ayoub Raffoul wrote:
>
> Hello
>
> 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

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

Dr. Who

unread,
Oct 24, 1996, 3:00:00 AM10/24/96
to

Richard Warbuton (leri...@itl.net) wrote:
: I had a similar problem where by the /etc/wtmp was growing at such an

: alarming rate it was filling the root file system. I finally got to the
: bottom of the problem with the help of a util written by our software house
: ages ago to display the contents of the /etc/wtmp file. In the file i found
: a TSU tty repeatedly logging on (Four times a second) and to cut a long
: story short traced it to an incorrectly terminated 'D' type on an r232
: cable.

: 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!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 new messages