Description of problem: isting below (this is a test case: first list the size of the file to rotate. Then show the test logrotate.conf Issue log rotate command. The file is not rotated. Note that the command says "rotating pattern... 1048576 bytes..." even though it states below that it will consider file >=1024bytes. Well, it doesn't appear to do that. An earlier version of logrotate from RedHat will rotate. [ssaux@stg1 logrotate]$ ll log/test.log -rw-rw-r-- 1 ssaux gate 18896 Apr 8 18:13 log/test.log [ssaux@stg1 logrotate]$ cat etc/logrotate.conf # #daily # keep only one file. rotate 1 # create new (empty) log files after rotating old ones create compress missingok notifempty create 0664 ssaux gate /home/ssaux/tmp/logrotate/log/test.log { size 1k } [ssaux@stg1 logrotate]$ /usr/sbin/logrotate -dv -s /home/ssaux/tmp/logrotate/etc/logrotate.state /home/ssaux/tmp/logrotate/etc/logrotate.conf reading config file /home/ssaux/tmp/logrotate/etc/logrotate.conf reading config info for /home/ssaux/tmp/logrotate/log/test.log Handling 1 logs rotating pattern: /home/ssaux/tmp/logrotate/log/test.log 1048576 bytes (1 rotations) empty log files are not rotated, only log files >= 1024 bytes are rotated, old logs are removed considering log /home/ssaux/tmp/logrotate/log/test.log log does not need rotating ====================================================================== ---------------------------------------------------------------------- stephanesaux - 2008-04-11 23:18 ---------------------------------------------------------------------- Another bug in this version of logrotate: Man page says that "daily" and "weekly" are ignore if a log uses "size" (but not if the log uses "minsize": minsize size Log files are rotated when they grow bigger then 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. But logrotate treats size and minsize the same. Again, Redhat 3 behaves according to the man page.
I've tried to reproduce your problem with logrotate-3.7.4-8, but everything looks to be OK: [tsmetana@dhcp-lab-208 logrotate-size]$ ll total 40 -rw-rw-r-- 1 tsmetana tsmetana 104 May 28 06:25 config -rw-rw-r-- 1 tsmetana tsmetana 84 May 28 06:29 status -rw-rw-r-- 1 tsmetana tsmetana 18896 May 28 06:30 the_log [tsmetana@dhcp-lab-208 logrotate-size]$ cat config rotate 1 create compress missingok notifempty /home/tsmetana/test/logrotate-size/the_log { size 1k } [tsmetana@dhcp-lab-208 logrotate-size]$ /usr/sbin/logrotate -vs status config reading config file config reading config info for /home/tsmetana/test/logrotate-size/the_log Handling 1 logs rotating pattern: /home/tsmetana/test/logrotate-size/the_log 1024 bytes (1 rotations) empty log files are not rotated, old logs are removed considering log /home/tsmetana/test/logrotate-size/the_log log needs rotating rotating log /home/tsmetana/test/logrotate-size/the_log, log->rotateCount is 1 renaming /home/tsmetana/test/logrotate-size/the_log.1.gz to /home/tsmetana/test/logrotate-size/the_log.2.gz (rotatecount 1, logstart 1, i 1), old log /home/tsmetana/test/logrotate-size/the_log.1.gz does not exist renaming /home/tsmetana/test/logrotate-size/the_log.0.gz to /home/tsmetana/test/logrotate-size/the_log.1.gz (rotatecount 1, logstart 1, i 0), old log /home/tsmetana/test/logrotate-size/the_log.0.gz does not exist log /home/tsmetana/test/logrotate-size/the_log.2.gz doesn't exist -- won't try to dispose of it renaming /home/tsmetana/test/logrotate-size/the_log to /home/tsmetana/test/logrotate-size/the_log.1 creating new log mode = 0664 uid = 500 gid = 500 compressing log with: /bin/gzip [tsmetana@dhcp-lab-208 logrotate-size]$ ll total 28 -rw-rw-r-- 1 tsmetana tsmetana 104 May 28 06:25 config -rw-rw-r-- 1 tsmetana tsmetana 84 May 28 06:30 status -rw-rw-r-- 1 tsmetana tsmetana 0 May 28 06:30 the_log -rw-rw-r-- 1 tsmetana tsmetana 53 May 28 06:30 the_log.1.gz What version of logrotate do you have installed?
[ssaux@stg1 logrotate]$ /usr/sbin/logrotate -dv logrotate 3.7.4 - Copyright (C) 1995-2001 Red Hat, Inc. This may be freely redistributed under the terms of the GNU Public License Usage: logrotate [-dfv?] [-d|--debug] [-f|--force] [-m|--mail command] [-s|--state statefile] [-v|--verbose] [-?|--help] [--usage] [OPTION...] <configfile>
Created attachment 307110 [details] captured shell session
I need to know also the release number of the package. Please send me the output of 'rpm -q logrotate'.
[ssaux@stg1 home]$ rpm -q logrotate logrotate-3.7.4-7
Please update to 3.7.4-8. What you report seems to be a duplicate of bug #247410.
*** This bug has been marked as a duplicate of 247410 ***