Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Oct 2004 20:58:48 -0400
From:      Garance A Drosihn <drosih@rpi.edu>
To:        questions <questions@davez.org>, freebsd-questions@freebsd.org
Subject:   Re: /var/log/wtmp always reseting to 0
Message-ID:  <p0611041ebd83ab2b25ce@[128.113.24.47]>
In-Reply-To: <20041001183944.W13734@zeus.davez.org>
References:  <F53D82B1-52C1-11D8-B33B-000393C0ABC0@antsclimbtree.com>    <20040213210413.T71247@admin1.mdc.net> <1311.66.243.145.38.1096668046.squirrel@www.l-i-e.com> <20041001183944.W13734@zeus.davez.org>

next in thread | previous in thread | raw e-mail | index | archive | help
At 6:52 PM -0400 10/1/04, questions wrote:
>On Fri, 1 Oct 2004, Richard Lynch wrote:
>
>>  man logrotate
>>
>  > Probably the logs are getting rotated and old ones discarded.
>
>    man logrotate does nothing

On FreeBSD, the utility is called newsyslog.
The entry would be in /etc/newsyslog.conf .
You should have an entry in there for /var/log/wtmp, but all that
will do is rotate the file.  It isn't going to truncate it.


>__________Snip Command Output_____
>    $ cd /var/log
>    $ ls -al wtmp*
>    -rw-r--r--  1 root  wheel  308 Oct  1 18:34 wtmp
>    -rw-r--r--  1 root  wheel    0 Oct  1 05:48 wtmp.0
>    -rw-r--r--  1 root  wheel    0 Oct  1 05:42 wtmp.1
>    -rw-r--r--  1 root  wheel    0 Oct  1 05:36 wtmp.2
>    -rw-r--r--  1 root  wheel    0 Oct  1 05:30 wtmp.3
>    $
>_______End Snip__________________

Uh, it seems odd that all those files have a date of "Oct 1".
newsyslog should only rotate the file once on any given day,
not five times, once every six minutes.  Did someone change the
entry for newsyslog in /etc/crontab ?  The only reference to
newsyslog in /etc/crontab should look like:

# Rotate log files every hour, if necessary.
0       *       *       *       *       root    newsyslog

-- 
Garance Alistair Drosehn            =   gad@gilead.netel.rpi.edu
Senior Systems Programmer           or  gad@freebsd.org
Rensselaer Polytechnic Institute    or  drosih@rpi.edu



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p0611041ebd83ab2b25ce>