logrotate strangeness (nothing worrisome however)
I've noticed something strange with logrotate, looking for insight and
explanation if you have one.
ls -1 /var/log/syslog* shows:
/var/log/syslog
/var/log/syslog.0
/var/log/syslog.1.gz
/var/log/syslog.2.gz
/var/log/syslog.3.gz
/var/log/syslog.4.gz
/var/log/syslog.5.gz
/var/log/syslog.6.gz
which tells me that delaycompress is delaying the gzipping of .0 until
the next rotation. This is nice and works as expected.
However, ls -1 /var/log/apache2/access* shows:
/var/log/apache2/access.log
/var/log/apache2/access.log.1
/var/log/apache2/access.log.2.gz
/var/log/apache2/access.log.3.gz
/var/log/apache2/access.log.4.gz
/var/log/apache2/access.log.5.gz
/etc/logrotate.d/apache contains this:
---------------------
/var/log/apache2/*.log {
weekly
missingok
rotate 6
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
if [ -f /var/run/apache2.pid ]; then
/etc/init.d/apache2 restart > /dev/null
fi
endscript
}
---------------------
Why do apache logs rotate from blah to blah.1 whereas syslog rotates
from syslog to syslog.0?
Tia,
-Jim P.
Reply to: