Overflowing wtmp

David H. Brierley dave at galaxia.Newport.RI.US
Sat Feb 2 14:41:45 AEST 1991


In article <1991Jan29.182320.1489 at csn.org> skwu at spot.Colorado.EDU (WU SHI-KUEI) writes:
>...   I suppose one could read the whole file, close
>it, then re-open it and write only the last N structures as shown in
>Section 4 back.  But why bother??

Why?  Because when I have a problem with a system I like to be able to look
at that systems history, including a history of logins.  If I need to look
at the login history I dont want to know all of the logins since Sunday, I
want to know all of the logins for at least the last two weeks.  What I did
was to write a program that allows you to extract either the last N days or
the last N kbytes.  It does not attempt to rewrite the wtmp file so you
need to stick a shell script wrapper around it.  I run it every day (or
maybe every other day) at 3am from cron.  If anyone is interested in the
source send me e-mail and I will either mail it back or post it if there
is sufficient interest.
-- 
David H. Brierley
Home: dave at galaxia.newport.ri.us; Work: dhb at quahog.ssd.ray.com
Send comp.sources.3b1 submissions to comp-sources-3b1 at galaxia.newport.ri.us
%% Can I be excused, my brain is full. **



More information about the Comp.unix.admin mailing list