View Single Post

   
  #2 (permalink)  
Old 01-16-2008, 09:39 AM
Oscar del Rio
 
Posts: n/a
Default Re: Tool to cut down utmp(x) / wtmp(x)

Very wrote:
> I am looking the tool to cut down utmp(x) / wtmp(x) posted by Markus
> sometimes back but I could not find.


Don't know which script that is, but "man fwtmp" should help.

Example:

% last
(504 records)
wtmp begins Mon Nov 1 15:32

# Keep only last 100 records:

% /usr/lib/acct/fwtmp < /var/adm/wtmpx | tail -100 | /usr/lib/acct/fwtmp
-ic > /tmp/wtmpx

# Test it

% last -f /tmp/wtmpx
(48 records)
wtmp begins Sun May 8 12:09

# cp /tmp/wtmpx /var/adm/wtmpx


I've seen other solutions using dd to truncate the files since
their records are of fixed size. google:"truncate wtmpx"
Reply With Quote