[rsyslog] how to best rotate files

david at lang.hm david at lang.hm
Mon Sep 15 08:13:43 CEST 2008


looking through the rsyslog.conf man page I see ways to tell rsyslogd to 
run a command when a file is over a given size, but I see no examples or 
details of what that command can/should do.

what I want to do is to move the file out of the way, kick rsyslogd so 
that it starts writing to a new file, then compress the old file (which 
can take a significant amount of time)

traditionally I have rotated syslogs by doing a mv of the logfile followed 
by a kill -HUP of the syslog process (usually out of crontab)

In my testing of rsyslog I have been doing this, but once in a while 
rsyslog doesn't release the file it's writing and start a new one, instead 
it keeps writing to the old file.

so this means that my command can't spawn a background task that does a mv 
of the file followed by a kill -HUP of rsyslogd.

what should I be doing?

David Lang




More information about the rsyslog mailing list