Overflowing wtmp

Dean Riddlebarger dean at truevision.com
Thu Jan 24 02:02:31 AEST 1991


In article <92 at tdatirv.UUCP> sarima at tdatirv.UUCP (Stanley Friesen) writes:
>
>I have found that my wtmp file tends to grow without bound.
>This is annoying.  Is there any clean way to trim it, short of the rather
>crude 'cat /dev/null > /etc/wtmp' approach.  (I *do* know about cron,
>I just need to know what to put in it).

Noting that your mileage may vary on a Xenix system, our ISC systems all
have a cron script called /etc/cleanup, and this script contains a
very simple line:

> /etc/wtmp

The script runs out of cron every Sunday, which means that wtmp only
gets a week of growth max.

Now, as to cron, the line entry in the root crontab for this cleanup
script is:

17 5 * * 0 /bin/su root -c "/etc/cleanup > /dev/null"

Meaning, "at 5:17 a.m. on every Sunday run the /etc/cleanup script as
root, and send any output on stdout into the bit bucket".

On ISC UNIX the easiest way to set up all of this [assuming that the
/etc/cleanup script had not been shipped with the OS] would be:

[1]  cd /tmp
[2]  crontab -l >root   /* creates a copy of the root crontab file */
[3]  add a line like the "17 5 etc." above using your favorite editor
[4]  crontab root  /* resets cron with the new root file */
[5]  create /etc/cleanup, with the "> /etc/wtmp" line and whatever else
     you want to do for additional administration

This assumes that you are root while you do this.  [You have to be
careful with cron, it seriously looks at your UID in this flavor of
System V.  And, for all I know, all flavors...]

Hopefully, someone with more Xenix experience can provide a more detailed
posting on the vagaries, if any, of Xenix cron facilities.


-- 
<:>   Dean Riddlebarger                               "The bus came by   <:>
<:>   Truevision, Inc.                                  and I got on,    <:>
<:>   [317] 841-0332                                   That's when it    <:>
<:>   dean at truevision.com      uunet!epicb!dean         all began."      <:>



More information about the Comp.unix.admin mailing list