procmail
[Top] [All Lists]

Re: thoroughput estimation

1998-03-29 17:52:22
On Sun, 29 Mar 1998, Andrew Vardy wrote:
I'd like to keep a tally of the weekly thoroughput on mailing list.
Probably not create a bar graph exactly.  BUt -- say have a file which
contains "0", and then have that number be incremented every time a
message comes in that meets a recipe criterion, and message goes in one
folder.

        :0
        * (folder-delivery criteria here)
                {
                LOCKFILE=folder$LOCKEXT
                :0 hic
                |expr `cat file 2>&-` + 1 2>&- >file||echo 1 >file
                :0
                folder
                LOCKFILE=
                }

Substituting this for your current folder-delivering recipe, this would
increment a number in file everytime mail delivers to folder. If file
doesn't exist, or has something other than a number, then the first mail
creates (or clobbers) file, and writes a 1 in it.  Subsequent mails
increment the number upwards. You reset file by deleting it, or by
deleting it's content, or by rewriting it with 0. 

If you want something more complicated, with automated weekly reset and
perhaps storing the weekly totals, I'd write it as a shell script, and
have the recipe run the script intead of the command line above. 

David

<Prev in Thread] Current Thread [Next in Thread>