[ILUG] Help with gathering Exim mail stats.

Dave Rynne dave at dspsrv.com
Tue Nov 20 14:57:38 GMT 2001


> Hi.
> 
> My wonderful manager just came down to me and said that I have until 2pm to
> write a script that will look through a weeks mail logs and tell me that
> total size of all mails sent through our mail servers.

2pm in which timezone ?

> 
> Does anyone else using exim have this done already and is feeling
> particularly generous ?

Try something like:
TOTAL=0; for i in `grep "<=" /var/log/exim/mainlog | awk '{print $9}' \
| sed -e 's,S=,,'`; do TOTAL=$[$TOTAL+$i]; done; echo $TOTAL

That's really quick and dirty but it's a start ..

> 
> I'll gladly give over a heap of beers for the script :-)

Cool .. I'll mail you my address and you can have them delivered ;)

Dave

> 
> Regards,
> 
> Richard.
> 
> 
> 
> 
> -- 
> Irish Linux Users' Group: ilug at linux.ie
> http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
> List maintainer: listmaster at linux.ie
> 





More information about the ILUG mailing list