[Bug 230961] man page for newsyslog.conf(5) says that when specified, "BOTH" size conditions must be met. It should be "EITHER".
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon Aug 27 20:49:06 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230961
--- Comment #1 from Jamie Landeg-Jones <jamie at catflap.org> ---
The man page for newsyslog.conf(5) says that if both a size and a time interval
are specified, BOTH conditions must be satisfied for the file rotation to take
place:
> Time based trimming happens only if newsyslog(8) is run within one hour of
the specified time. If an interval is specified, the log file will be trimmed
if that many hours have passed since the last rotation. When both a time and
an interval are specified then both conditions must be satisfied for the
rotation to take place.
This is wrong. The rotation will take place if EITHER condition takes place.
Consider this test, creating an entry that will be rotated when the file size
reaches 10Mb, and the file is older than a day:
Cheers, Jamie
# echo "/tmp/test 555 10 10000 24 N" >> /etc/newsyslog.conf
# touch /tmp/test
# newsyslog -v /tmp/test
Processing /etc/newsyslog.conf
Found: <include> /etc/newsyslog.conf.d/*
Found: <include> /usr/local/etc/newsyslog.conf.d/*
/tmp/test <10>: size (Kb): 0 [10000] age (hr): -1 [24] --> trimming log....
# l /tmp/test*
4 -r-xr-xr-x 1 root wheel - 61 27 Aug 21:07 /tmp/test
4 -r-xr-xr-x 1 root wheel - 61 27 Aug 21:07 /tmp/test.0
# newsyslog -v /tmp/test
Processing /etc/newsyslog.conf
Found: <include> /etc/newsyslog.conf.d/*
Found: <include> /usr/local/etc/newsyslog.conf.d/*
/tmp/test <10>: size (Kb): 1 [10000] age (hr): 0 [24] --> skipping
# dd if=/dev/random bs=1k count=10 | od -c > /tmp/test
10+0 records in
10+0 records out
10240 bytes transferred in 0.000317 secs (32312115 bytes/sec)
# l /tmp/test*
48 -r-xr-xr-x 1 root wheel - 47,103 27 Aug 21:09 /tmp/test
4 -r-xr-xr-x 1 root wheel - 61 27 Aug 21:07 /tmp/test.0
# newsyslog -v /tmp/test
Processing /etc/newsyslog.conf
Found: <include> /etc/newsyslog.conf.d/*
Found: <include> /usr/local/etc/newsyslog.conf.d/*
/tmp/test <10>: size (Kb): 46 [10000] age (hr): 0 [24] --> skipping
# l /tmp/test*
48 -r-xr-xr-x 1 root wheel - 47,103 27 Aug 21:09 /tmp/test
4 -r-xr-xr-x 1 root wheel - 61 27 Aug 21:07 /tmp/test.0
# touch -r /COPYRIGHT /tmp/test.0
# l /tmp/test*
48 -r-xr-xr-x 1 root wheel - 47,103 27 Aug 21:09 /tmp/test
4 -r-xr-xr-x 1 root wheel - 61 24 Jun 2017 /tmp/test.0
# newsyslog -v /tmp/test
Processing /etc/newsyslog.conf
Found: <include> /etc/newsyslog.conf.d/*
Found: <include> /usr/local/etc/newsyslog.conf.d/*
/tmp/test <10>: size (Kb): 46 [10000] age (hr): 10302 [24] --> trimming
log....
# l /tmp/test*
4 -r-xr-xr-x 1 root wheel - 61 27 Aug 21:10 /tmp/test
48 -r-xr-xr-x 1 root wheel - 47,164 27 Aug 21:10 /tmp/test.0
4 -r-xr-xr-x 1 root wheel - 61 24 Jun 2017 /tmp/test.1
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the freebsd-doc
mailing list