procmail
[Top] [All Lists]

Re: Counting hits - revisited

2004-06-06 02:42:05
Toen wij fleet(_at_)teachout(_dot_)org kietelden, kwam er dit uit:
Ruud H.G. van Tol:

'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-03.ctr:12507

That's a lot of dots.

The blocksize on your harddisk is bound to be bigger than most of 
those files, in many file systems a single byte file already 
occupies 4 KB or even more. So the amount of dots (or whatever 
character) is normally not a real issue.


-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.

You don't read the dots, you read the filesize. I stead of the 6 that 
you see there, you would immediately see the number of hits, next to 
the date and time of the last hit. How is that for convenient?


'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.

It's an alternative, published on a public mailing list. Other people 
will have reasons to choose the second alternative.


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.

I'm glad that I don't have your mind. Once you choose the second 
alternative, you need a way to get the number of hits from the 
number of lines in the file. 'wc -l' can do that for you.

-- 
Grtz, Ruud

_______________________________________________
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>