Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Odd logrotate.d behavior

Status
Not open for further replies.

forrie

MIS
Mar 6, 2009
91
US
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.
 
You simply missed the rotate directive

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for the pointer. Strange, I thought that rotate was just implied.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top