On 5/26/05, Gaby vanhegan <[EMAIL PROTECTED]> wrote:
> A while back I wrote some scripts to parse spamd logs (and rblsmtpd and
> spamassassin logs) and run them through rrdtool and generate graphs
> from them.  I use newsyslog to rotate the spamd logs prior to running
> them through the handling script, which processes the logs on an hourly
> basis.
> 
> One problem I have is that sometimes spamd logs a connection between
> the time cron fires up to rotate the logs, and the time newsyslog is
> actually run (ie 1-2 seconds after the hour), which breaks the logging
> mechanism (description below).
> 
> Short of putting the newsyslog cronjob right at the top of root's
> crontab, is there any way to make this happen quicker, or immediately,
> and exactly on the hour?
. . .
>  It's simpler to ensure that the logfile cutoff is actually on the hour,
> preventing the situation described above.

If you switch over to syslog-ng, you can configure the daemon itself
to directly write to files named for the hour of the day in which the event
occurs.  This eliminates the need to use newsyslog at all.

You can find syslog-ng in ports, /usr/ports/sysutils/syslog-ng

Kevin Kadow

Reply via email to