logrotate help :(

jseely13 at charter.net jseely13 at charter.net
Wed Apr 28 10:18:55 PDT 2004

i've done my best to rtfm and google around, but i can't figure out why this is happening.  

logrotate runs right the first time, moving the right logs to the backup folder and compressing them to logname.1.bz2, but then the 2nd time it runs it's not doing the mv it's supposed to (if i understand correctly) for mv logname.1.bz2 logname.2.bz2, so bzip complains the file already exists...

i'm running 5.1 release, and have installed the logrotate 3.6.5 port...


#test logrotate configuration file

/var/log/test2/* {
    rotate 5
    olddir /var/log/backup
    compresscmd /usr/bin/bzip2

#copy test logs to test dir
[root at box log]§ cp test/* test2/

[root at box log]§ logrotate -s /usr/local/var/status /etc/logrotate.conf

#copy a newer version of one of the test logs into the test dir
[root at box log]§ cp remote/box01 test2/
[root at box log]§ logrotate -s /usr/local/var/status /etc/logrotate.conf
bzip2: Output file /var/log/backup/box01.1.bz2 already exists.
failed to compress log /var/log/backup/box01.1

[root at box log]§ ls -al /var/log/backup/
total 33620
drwxr-xr-x  2 root wheel      512 Apr 28 11:59 .
drwxr-xr-x  8 root wheel     1536 Apr 28 03:01 ..
-rw-r-----  1 root wheel  3128184 Apr 28 11:57 box00.1.bz2
-rw-r-----  1 root wheel 29019450 Apr 28 11:59 box01.1
-rw-r-----  1 root wheel  2202570 Apr 28 11:57 box01.1.bz2


i'm stumped... i know it's not supposed to run more than once per day (per the man page), but i got this exact behavior when i waited a day...  tx for any help you can provide...

-- john

More information about the freebsd-questions mailing list