[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: newsyslog not rotating a log file
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Re: newsyslog not rotating a log file
- From: Chuck Yerkes <chuck+obsd_(_at_)_2003_(_dot_)_snew_(_dot_)_com>
- Date: Sat, 18 Jan 2003 01:54:14 -0500
- Mail-followup-to: Chuck Yerkes <chuck+obsd_(_at_)_2003_(_dot_)_snew_(_dot_)_com>, misc_(_at_)_openbsd_(_dot_)_org
- Reply-to: misc_(_at_)_openbsd_(_dot_)_org
Put the newsyslog.conf line alone in a file.
Lets call it: "/tmp/testnsl.conf"
Then run:
newsyslog -f /tmp/testnsl.conf -v -n
-n says "don't really do it"
-v says be verbose about it.
See what it says.
Quoting Jim Breton (jamesb-openbsd_(_at_)_alongtheway_(_dot_)_com):
> Hello, I'm not a newbie to OpenBSD.. been running it for a couple years
> actually.
>
> But sometimes I feel like a newbie, and this is one of those times. ;)
>
> I added a log file to be rotated into my newsyslog.conf:
>
> /var/log/kern 644 14 * 24 Z
>
> In syslog.conf I have the following:
>
> kern.debug /var/log/kern
>
> And the file is being written by syslog, no problem there.
>
>
> However, I can't seem to get newsyslog to rotate it -- unless I manually
> force it with -F:
>
> # ls -lat kern* # (each of these is the result of a forced rotation)
> -rw-r--r-- 1 root wheel 60 Jan 17 05:27 kern
> -rw-r--r-- 1 root wheel 348 Jan 17 05:27 kern.0.gz
> -rw-r--r-- 1 root wheel 463 Jan 15 07:42 kern.1.gz
>
>
> I noticed that it was not being rotated by the hourly newsyslog job, so I
> started playing with the options in newsyslog.conf. Watch what happens if
> I set the rotation time to different numbers of hours and then run
> 'newsyslog -n -v':
>
> 24 hours:
> /var/log/kern <14Z>: age (hr): 22 [24] --> skipping
>
> 23 hours:
> /var/log/kern <14Z>: age (hr): 22 [23] --> skipping
>
> 22 hours:
> /var/log/kern <14Z>: age (hr): 22 [22] --> skipping
>
> 21 hours:
> /var/log/kern <14Z>: age (hr): 22 [21] --> skipping
>
>
> Seems that no matter what value I use, it just will not rotate.
>
> What am I doing wrong?
>
> Thanks.
Visit your host, monkey.org