1833758 Members
2564 Online
110063 Solutions
New Discussion

wtmp

 
SOLVED
Go to solution
Peter Lachnitt
Advisor

wtmp

Hello,
i have the problem that /var/adm/wtmp is too big but i can?t clear it to zero. Has someone experience with the fwtmp? Is it possible to
to read out wtmp and cut it like a tail -200 and wright it back?

Regards Peter
Peter Lachnitt
3 REPLIES 3
Michael Lee_4
Advisor

Re: wtmp

just do the following:

#>wtmp


Regards
Dan Hetzel
Honored Contributor

Re: wtmp

Hi Peter,

Zeroing the file with (as root):
cp /dev/null /var/adm/wtmp should work.

You could run /usr/sbin/acct/runacct as this will invoke 'closewtmp' before creating a new wtmp file

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
federico_3
Honored Contributor
Solution

Re: wtmp


to read wtmp file do like this:

the following will convert it to ASCII file
#/usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/file
then you can either edit the file or read it.

Then you can convert it back to binary form:
##/usr/sbin/acct/fwtmp -ic < /tmp/file > /var/adm/wtmp


Bye
federico