My logrotating done by logrotated doesn't work anymore...

/var/log/squid/*.log {
    weekly
    rotate 52
    size 100M
    compress
    notifempty
    missingok
    sharedscripts
    postrotate
      # Asks squid to reopen its logs. (logfile_rotate 0 is set in squid.conf)
      # errors redirected to make it silent if squid is not running
      /usr/sbin/squid -k rotate 2>/dev/null
      # Wait a little to allow Squid to catch up before the logs is compressed
      sleep 60
    endscript
}

I end up with an access.log that has the wrong number and logrotate
can't compress it.

I think what is happening is logrotate renames access.log to
access.log.0, and then squid -k rotate renames it to access.log.1, and
then logrotate tries to compress logrotate.0, which it now can't find.
 Or something like that.  My uncompressed store.log is actually at .2

I've worked around it by setting logfile_rotate to 0, but I'm
wondering if this is a recent change with unexpected side effects when
working with logrotate.

Rich

Reply via email to