Mark Douglas <[EMAIL PROTECTED]> wrote:
> I'm trying to figure out how I should get the stats I want out of
> qmailanalog, along with some other things I'd like to do. My main issue is,
> if I wanted to do a daily log rotation, would it be feasible to do the
> following (using multilog): Set my logfile size to 100MB; at end of day,
> have a cron job run that copies the "current" file to another, dated file;
> echo > /var/log/qmail/current to empty out the log file and start fresh. I
> realize it's not pretty, but the real issue is, would it cause problems?

Yes -- each message has multiple log lines associated with it.  You'll likely
get some messages which cross over your arbitrary per-night boundaries.  qmail
won't be able to include those messages in its analysis if you just analyze
one log at a time.

However, it's probably going to have a negligible impact on the overall
statistics.  I posted a shell script to this list last week which does exactly
what you want, suitable for use as a nightly cron job.  And because it uses
qlogselect from Bruce Guenter's qlogtools package, you don't need to rotate
the scripts nightly to split the statistics up per-day -- qlogselect will
automatically extract the log entries for a time period you specify.  The
script filters it down to one day.

Charles
-- 
-----------------------------------------------------------------------
Charles Cazabon                            <[EMAIL PROTECTED]>
GPL'ed software available at:  http://www.qcc.sk.ca/~charlesc/software/
-----------------------------------------------------------------------

Reply via email to