[rsyslog] how to best rotate files
Rainer Gerhards
rgerhards at hq.adiscon.com
Mon Sep 15 08:54:59 CEST 2008
This, too, is quite old, to-be-replaced on demand functionality ...
without any demand for replacement up to now ;)
Do you know this guide:
http://www.rsyslog.com/doc-log_rotation_fix_size.html
The shell script could spawn off an async process, but I have never
tried this...
Also <inline>:
On Sun, 2008-09-14 at 23:13 -0700, david at lang.hm wrote:
> 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.
This very much smells like a bug. Can you elaborate on what you did?
>
> 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
>
> _______________________________________________
> rsyslog mailing list
> http://lists.adiscon.net/mailman/listinfo/rsyslog
More information about the rsyslog
mailing list