[clug] Logrotate not rotating a log?
Alex Satrapa
grail at goldweb.com.au
Mon Feb 15 19:27:37 MST 2010
Perhaps I'm being a little impatient, but if I've got logrotate configured to rotate a particular log file weekly, and the log file as it exists was created over six months ago, shouldn't logrotate actually rotate the log file when I run "logrotate -v /etc/logrotate.conf"?
Here's the logrotate.d/mything config:
/var/log/apache2/sites/mything/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
/etc/init.d/apache2 reload > /dev/null
fi
endscript
}
When I added "size 100M" to this config, the log was rotated on the spot (it was about 500MB long at the time).
Curious as to whether logrotate was storing timestamps, and only rotating after a particular file had been seen by logrotate for longer than a certain period, I did have a look around but couldn't see any files left around by logrotate in /var/run or /var/cache.
Alex
More information about the linux
mailing list