Article View: can.usrgroup
Article #740Re: Trimming the wtmp file
From: Bruce Becker
Date: Fri, 22 May 1992 05:54
Date: Fri, 22 May 1992 05:54
29 lines
1272 bytes
1272 bytes
In article <9205201503.AA01446@moore.com> paul@moore.com (Paul Maclauchlan) writes: |Is there a utility that I can use to trim the contents of the wtmp |file from the "top"? | |I'd like to keep a month or so of data, but lose what is older. | |Thanks for your help! Here's what I run weekly: cd /etc/wt for i in 5 4 3 2 1 do j=`expr $i - 1` if [ -f wtmp.$j ]; then compress wtmp.$j; fi if [ -f wtmp.$j.Z ]; then mv wtmp.$j.Z wtmp.$i.Z; fi done mv /etc/wtmp wtmp.0 cp /etc/utmp /etc/wtmp -- ,u, Bruce Becker Toronto, Ontario a /i/ Internet: bdb@becker.gts.org Uucp: ...!lsuc!becker!bdb `\o\-e "Not only am I the President of the Unfair Club for Men, _< /_ I'm also a client" - G. Bush
Technical Details
Message-ID:
<1992May22.055436.13615@becker.GTS.ORG>Path:
arc1-ca.pugleaf.net!sparky!uunet!uunet.ca!geac!becker!bdbReferences:
<9205201503.AA01446@moore.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1149bd,382dd2fa7fff7473 X-Google-Attributes: gid1149bd,public X-Google-ArrivalTime: 1992-05-22 05:17:00 PST Newsgroups: can.usrgroup Path: arc1-ca.pugleaf.net!sparky!uunet!uunet.ca!geac!becker!bdb From: bdb@becker.GTS.ORG (Bruce Becker) Subject: Re: Trimming the wtmp file Message-ID: <1992May22.055436.13615@becker.GTS.ORG> Organization: G. T. S., Toronto, Ontario References: <9205201503.AA01446@moore.com> Distribution: ont Date: Fri, 22 May 1992 05:54:36 GMT Lines: 29