Article View: can.usrgroup
Article #741Re: Trimming the wtmp file
From: Paul Maclauchlan
Date: Tue, 26 May 1992 17:10
Date: Tue, 26 May 1992 17:10
34 lines
1999 bytes
1999 bytes
In article <1992May21.032639.7720@robohack.UUCP>, woods@robohack.UUCP (Greg A. Woods) writes:
> 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"?
>
> Ideally you'd want to chop it off at a given date, but this would
> require a bit of programming.
Trimming a number of records would be fine.
> However, if you want to simply chop off some number of records from
> the file, dd can do the job (example specific to SysVr3.1):
>
> wtmprecsize=36 # this is the number 'sizeof(struct utmp)'
> nchop=1000 # how many records to chop off
> dd if=wtmp of=wtmp.tmp bs=$wtmprecsiz skip=$nchop
> cp wtmp.tmp wtmp # must not use mv in case file is open
Excellent! Does anyone know the Sun 4.1.1 value for "wtmprecsize"?
(Sorry for the dumb question....)
> I presume this is simply to satisfy users of last(1).... If not, then
> why not just roll over the wtmp file every day/week/month?
I'd like to keep a minimum number of days/months data available. Rolling
the file means that each time it is restarted, there is no history.
Thanks for your help, Greg.
--
.../Paul Maclauchlan
Moore Corporation Limited, Toronto, Ontario (416) 364-2600
paul@moore.com -or- {...!uunet.ca,...!telly}!moore!paul
"I thought it but I kept it hid"/EJ&BT'83
Technical Details
Message-ID:
<1992May26.171032.28402@moore.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!news-server.csri.toronto.edu!utgpu!utzoo!telly!moore!paulReferences:
<9205201503.AA01446@moore.com> <1992May21.032639.7720@robohack.UUCP>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-26 10:22:24 PST Newsgroups: can.usrgroup Path: arc1-ca.pugleaf.net!sparky!uunet!news-server.csri.toronto.edu!utgpu!utzoo!telly!moore!paul From: paul@moore.com (Paul Maclauchlan) Subject: Re: Trimming the wtmp file Message-ID: <1992May26.171032.28402@moore.com> Organization: Moore Corporation Limited, Toronto ON, Canada References: <9205201503.AA01446@moore.com> <1992May21.032639.7720@robohack.UUCP> Date: Tue, 26 May 92 17:10:32 GMT Lines: 34