According to the logrotate documentation, the "size" and time specifications like "yearly" are mutually exclusive. (Currently there is a bug in the parsing of "size" which makes it to be interpreted as "minsize" instead, see bug 723547.) The logrotate configuration for "yum" contains both "size 30k" and "yearly". Is the intention to rotate yearly, but only if the size is more than 30 kB? Then "minsize" should be used instead of "size". Is the intention to just rotate yearly? Then "size" should be removed. And vice versa, if the intention is to rotate whenever the file grows larger than 30 kB. Maybe the intention is to rotate when EITHER a year has passed or the file is larger than 30 kB. As I understand it, that possibility is not currently supported by logrotate.
> Maybe the intention is to rotate when EITHER a year has passed or the file is > larger than 30 kB. As I understand it, that possibility is not currently > supported by logrotate. This was the intention (and it worked, AFAIK). Specifically we used just "size = 30k", but then people complained about it not rotating every year (because the syslog format doesn't include years -- so it would become confusing).
It cannot work like that, because the logrotate source code does not implement it like that. It is an if-else in the code, an either "size" or "yearly", and latest option in the config file wins: The manual comments on that in several ways: | [...] later definitions override earlier ones) And on how "size" is special: | minsize size | Log files are rotated when they grow bigger than size bytes, but | not before the additionally specified time interval (daily, | weekly, monthly, or yearly). | | The related size option is similar | except that it is mutually exclusive with the time interval | options, and it causes log files to be rotated without regard | for the last rotation time. When minsize is used, both the size | and timestamp of a log file are considered.
Also, repeating the debug mode example: $ logrotate -d /etc/logrotate.d/yum reading config file /etc/logrotate.d/yum Handling 1 logs rotating pattern: /var/log/yum.log yearly (no old logs will be kept) empty log files are not rotated, only log files >= 30720 bytes are rotated, old logs are removed considering log /var/log/yum.log log does not need rotating $ ls -hs /var/log/yum.log 120K /var/log/yum.log And for comparison, with an old logrotate-3.7.8-12.fc14 that doesn't suffer from bug 723547 and doesn't parse "size" as "minsize" by mistake: $ logrotate -d /etc/logrotate.d/yum reading config file /etc/logrotate.d/yum reading config info for /var/log/yum.log Handling 1 logs rotating pattern: /var/log/yum.log yearly (no old logs will be kept) empty log files are not rotated, old logs are removed considering log /var/log/yum.log log does not need rotating $ ls -hs /var/log/yum.log 120K /var/log/yum.log In other words, currently, it only rotates yearly.
Michael already answered for me while I was asleep, so I'll add this little comment to clear the needinfo flag. And FYI: I just filed bug 727797 with a suggestion to add support to logrotate for what you want to do. But obviously, that is for the future, it won't work now.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
This message is a notice that Fedora 15 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 15. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At this time, all open bugs with a Fedora 'version' of '15' have been closed as WONTFIX. (Please note: Our normal process is to give advanced warning of this occurring, but we forgot to do that. A thousand apologies.) Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, feel free to reopen this bug and simply change the 'version' to a later Fedora version. Bug Reporter: Thank you for reporting this issue and we are sorry that we were unable to fix it before Fedora 15 reached end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged to click on "Clone This Bug" (top right of this page) and open it against that version of Fedora. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping