Operating System - HP-UX
1753973 Members
8022 Online
108811 Solutions
New Discussion

reduce size of /var/adm/utmps

 
Philemon_2
Frequent Advisor

reduce size of /var/adm/utmps

Some one please suggest the proper way to reduce the size of /var/adm/utmps ?

HP-UX B.11.23 U ia64

Thanks,
Phil
1 REPLY 1
James R. Ferguson
Acclaimed Contributor

Re: reduce size of /var/adm/utmps

Hi Phil:

I presume that you mean '/var/adm/wtmps' --- the repository for login activity as read by 'last()'. The 'utmps' file contains accounting information for users currently logged on to the server (as for viewing with 'who -u'. It is replicated to 'wtmps' upon logoff.

If you don't wish to login session data, simply truncate the file:

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

(or):

# > /var/adm/wtmps

If you wish to retain part of the file, convert the binary data to ASCII text; edit the ASCII text and convert that back to the binary format:

# /usr/sbin/acct/fwtmp -X < /var/adm/wtmps > /tmp/wtmps

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

Regards!

...JRF...