Thanks Dan. Ordinarily that would be the perfect answer to my prob, but
it would just use too much disk space. I reckon that two days worth
would use up about 1.5gb of space,which is just too much at the moment.
-----Original Message-----
From: D.J. Fan [mailto:***@hotmail.com]
Sent: 29 July 2005 15:13
To: postfix-***@postfix.org
Subject: Re: Pflogsumm and gzip'd logs
Post by Oliver MarshallThanks Ralf. Just to make it clear for me (as im not a linux bod,
/usr/bin/pflogsumm.pl /var/log/maillog <switches go here>
Can I just use
zcat mail.log.gz | pflogsumm.pl <switches go here>
In its place in crontab ?
Yes.
I have the problem where my logs rotate (and compress) a couple times a
day, so I made a script to concatenate the 3 latest log files (or
however many that will insure you get a couple days worth of data),
called it pflogsumm, placed it in /etc/cron.daily and made it
executable. I'm sure this could be optimized a little better.
#!/bin/sh
zcat /var/log/mail.log.1.gz >/var/log/maillog1 zcat
/var/log/mail.log.2.gz >/var/log/maillog2 cat /var/log/mail.log
/var/log/mail.log.0 /var/log/maillog1
/var/log/maillog2 >/var/log/maillog4
/usr/sbin/pflogsumm.pl -i -d yesterday --problems_first
/var/log/maillog4
2>&1 |/usr/bin/mail -s "DAILY mail summary" root
rm /var/log/maillog1
rm /var/log/maillog2
rm /var/log/maillog4
This example will wrap, see it unwrapped here:
http://www200.pair.com/mecham/spam/pflogsumm
D.J. Fan
_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/