Friday, April 18, 2008

AIX reduce wtmp size

To edit the /var/adm/wtmp file, first copy the file temporarily with the following
command:
# /usr/sbin/acct/fwtmp < /var/adm/wtmp >/tmp/out
#
Edit the /tmp/out file to remove unwanted entries, then replace the original file
with the following command:
# tail -1000 /tmp/out > /tmp/in
# /usr/sbin/acct/fwtmp -ic < /tmp/in > /var/adm/wtmp

or

#cp /dev/null /var/adm/wtmp

No comments:

UNIX: How to print column nicely using printf

[user@hostfwnms1-oam tmp]# cat b.sh printf "%-26s %-19s %-8s %-8s %-s %-s\n" HOSTNAME IP PING SNMPWALK 0-ok 1-fail for i in `cat n...