I've configured logrotate to handle one of our development logs. But, it's not really behaving as I would expect. Here's the config:
/var/log/dce/*log {
missingok
size 100M
create 0644 filecopy staff
notifempty
dateext
compress
}
Here's what happens when I run it manually:
# /usr/sbin/logrotate -v /etc/logrotate.d/dceservices
reading config file /etc/logrotate.d/dceservices
reading config info for /var/log/dce/*log
Handling 1 logs
rotating pattern: /var/log/dce/*log 104857600 bytes (no old logs will be kept)
empty log files are not rotated, old logs are removed
considering log /var/log/dce/dce.services.log
log needs rotating
rotating log /var/log/dce/dce.services.log, log->rotateCount is 0
glob finding old rotated logs failed
renaming /var/log/dce/dce.services.log to /var/log/dce/dce.services.log-20111118
disposeName will be /var/log/dce/dce.services.log-20111118.gz
creating new log mode = 0644 uid = 16326 gid = 90
compressing log with: /bin/gzip
removing old log /var/log/dce/dce.services.log-20111118.gz
# ls -l
total 514232
-rw-r--r-- 1 filecopy staff 0 Nov 18 15:26 dce.services.log
Blam, gone. What I don't understand is the first part where it says it will not retain old logs -- I didn't tell it to NOT retain them, I told it to rename and compress anything *.log in that directory.
Can someone point out what's wrong here?
Thanks.
/var/log/dce/*log {
missingok
size 100M
create 0644 filecopy staff
notifempty
dateext
compress
}
Here's what happens when I run it manually:
# /usr/sbin/logrotate -v /etc/logrotate.d/dceservices
reading config file /etc/logrotate.d/dceservices
reading config info for /var/log/dce/*log
Handling 1 logs
rotating pattern: /var/log/dce/*log 104857600 bytes (no old logs will be kept)
empty log files are not rotated, old logs are removed
considering log /var/log/dce/dce.services.log
log needs rotating
rotating log /var/log/dce/dce.services.log, log->rotateCount is 0
glob finding old rotated logs failed
renaming /var/log/dce/dce.services.log to /var/log/dce/dce.services.log-20111118
disposeName will be /var/log/dce/dce.services.log-20111118.gz
creating new log mode = 0644 uid = 16326 gid = 90
compressing log with: /bin/gzip
removing old log /var/log/dce/dce.services.log-20111118.gz
# ls -l
total 514232
-rw-r--r-- 1 filecopy staff 0 Nov 18 15:26 dce.services.log
Blam, gone. What I don't understand is the first part where it says it will not retain old logs -- I didn't tell it to NOT retain them, I told it to rename and compress anything *.log in that directory.
Can someone point out what's wrong here?
Thanks.