1832833 Members
2979 Online
110047 Solutions
New Discussion

wtmps

 
SOLVED
Go to solution
Joe415
Contributor

wtmps

Hi all

The wtmps file on 1 of our servers is very large (11.23). Is there a way of decreasing the size of this file?

Thanks
Joe
4 REPLIES 4
Pete Randall
Outstanding Contributor
Solution

Re: wtmps

Try "> /var/adm/wtmp".


Pete

Pete
David Bellamy
Respected Contributor

Re: wtmps

Joe do a man on fwtmp, hope this helps
James R. Ferguson
Acclaimed Contributor

Re: wtmps

Hi:

The 'wtmps' file is a binary file and hence cannot be directly editted. This leaves you two choices:

(1) completely truncate the file:

# cat /dev/null > /var/adm/wtmps

or (2), convert the binary file to an Ascii one; edit the Ascii copy to remove all but the most recent contents; and convert the editted file from Ascii to binary:

# /usr/sbin/acct/fwtmp < /var/adm/wtmp > /var/tmp/wtmp
# vi /var/tmp/wtmp
# /usr/sbin/acct/fwtmp -ic < /var/tmp/wtmp > /var/adm/wtmp

Regards!

...JRF...
radkol
Advisor

Re: wtmps

Hi,
I'd suggest you first to check what's the reason for such a big wtmpx file.
You should be able to see more information about this with
/usr/sbin/acct/fwtmp

Usually it's caused by scripts started from inittab, when the script start and stop it's logged in wtpmx. So if you have scripts which exits you will have very fast growing wtmpx.