procmail
[Top] [All Lists]

Re: "Atomic" updates to the LOGFILE...

2002-07-26 08:56:10
On Thu, 25 Jul 2002, Michael J Wise wrote:

Here's what we do now (snarfed from Bart Schaefer 
<schaefer(_at_)zanshin(_dot_)com>,
from a post to this list on 2002.05.30):

      TEMPFILE=$HOME/procmail.log.$$
      REALFILE=$HOME/procmail.log
      LOGFILE=$TEMPFILE
      TRAP='procmail -p DEFAULT=$REALFILE /dev/null < $TEMPFILE && rm -f 
$TEMPFILE'

We'd like something a bit more economical in terms of processor
performance, as we are trying to run some scripts based on the logfiles
to report the 'Performance' of our SpamTraps.

So drop the TRAP and allow one file per process to accumulate until you're
ready to do the log analysis, and then concatenate the files all at once.

If you have enough traffic that your PIDs roll over, you'll get more than
one log in each file, so you might have to add date-sorting of the log
entries to the analysis program; but that shouldn't reduce the performance
very much (unless you're waiting a _really_ long time between runs).

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail