Logfile rotation, which is handled by newsyslog, can be done based on 1) max size of file, 2) at certain time.
My questions is: how does it work when both the conditions are specified? I'd expect it'll rotate when any one condition is met. Is that correct?
But for example, in my newsyslog.conf I have (by default) for auth.log:
So there can be max 7 files, with a size of 100KB max, and it is rotated on every 1st of Jan.
Now when I look at the logs, I see they get rotated according to neither of the criteria (max size 100KB and 1st Jan). I am sure it is a simple thing, but I just don't know. Can someone please help me understand what's going on?
My questions is: how does it work when both the conditions are specified? I'd expect it'll rotate when any one condition is met. Is that correct?
But for example, in my newsyslog.conf I have (by default) for auth.log:
Code:
/var/log/auth.log 600 7 100 @0101T JC
Now when I look at the logs, I see they get rotated according to neither of the criteria (max size 100KB and 1st Jan). I am sure it is a simple thing, but I just don't know. Can someone please help me understand what's going on?
Code:
> ls -hlo /var/log/auth.log*
-rw------- 1 root wheel uarch 88K May 11 03:00 /var/log/auth.log
-rw------- 1 root wheel uarch 12K Apr 25 03:00 /var/log/auth.log.0.bz2
-rw------- 1 root wheel uarch 12K Apr 11 16:00 /var/log/auth.log.1.bz2
-rw------- 1 root wheel uarch 11K Mar 30 07:00 /var/log/auth.log.2.bz2
-rw------- 1 root wheel uarch 9.9K Mar 21 20:00 /var/log/auth.log.3.bz2
-rw------- 1 root wheel uarch 9.5K Mar 17 22:00 /var/log/auth.log.4.bz2
-rw------- 1 root wheel uarch 11K Mar 15 06:00 /var/log/auth.log.5.bz2
-rw------- 1 root wheel uarch 12K Mar 1 02:00 /var/log/auth.log.6.bz2