procmail
[Top] [All Lists]

Re: Counting hits - revisited

2004-06-05 20:45:22
On Sun, 6 Jun 2004, Ruud H.G. van Tol wrote:

I assumed that what you do now is, per specific hit,
- read the counter from the specific file
- increment the counter
- and write the counter back

Yes. But I'd say it:

read the number from the counter file
increment the number
write the new number to the counter file

'my' first alternative is:
- for each hit, append a single byte character to that specific file

My top ten counters for the past year:
MSGID-26.ctr:699
MSGID-45.ctr:851
MSGID-60.ctr:1800
MSGID-36.ctr:1818
MSGID-46.ctr:3223
MSGID-37.ctr:4195
MSGID-01.ctr:4665
MSGID-14.ctr:5121
MSGID-35.ctr:7102
MSGID-03.ctr:12507

That's a lot of dots.

-rw-rw-r--    1 fleet    fleet           6 Jun  5 19:09 MSGID-03.ctr

This counter contains 6 bytes.  I suspect 12507 dots would amount to a bit
more and would be terribly hard to read.

'my' second alternative is:
- for each hit, append a line with the message's Message-ID (and
even with more info, like date and time, each field separated by
a Tab) to that specific file

Again, with 1,000 or 5,000 or 12,000 lines, we're talking some sizeable
files.  Most of this information I already put in the "offending" message
using formail. Mostly I need the info so I can try to determine what needs
changing if I get a false positive.  I prefer it to be in the message I'm
studying.  If there's no problem with a spam message, I generally just
delete it.

Suppose the file contains 100 lines. That means that the specific
condition has been hit 100 times before.

See also 'man wc'.

wc -l counts the lines; but it's no part of a procmail method for updating
and maintaining counters.

                                - fleet -



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

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