Red Hat Bugzilla – Bug 1932
logrotate behaviour inconsistent
Last modified: 2008-05-01 11:37:49 EDT
rotate 2 -> logs are mailed and disappear after being
rotated twice. pre/postrotate scripts are executed.
rotate 1 -> logs are mailed and disappear after being
rotated once. pre/postrotate scripts are executed.
rotate 0 -> logs are removed. pre/postrotate scripts are
Logically, rotate 0 would mail logs and leave no rotated
log. Instead, rotate 0 simply removes the log, and ignores
the pre/postrotate scripts.
The man page says "if count is 0, old versions are removed
rather then [sic] rotated." By vague inference, you *might*
be able to figure out that if the log isn't rotated, the
pre/postrotate scripts won't run, but what is more likely is
that you set count to zero and scratch your head wondering
why your logs are never mailed and your process never gets
the HUP signal sent in the postrotate script.
Erik, do we want to change this, or leave as is?
FYI, the bug (RFE) I filed for being able to send mail of the
first item instead of the last one (which now includes URLs for
patches) is bug #2103.
A new logrotate tarball is at