procmail
[Top] [All Lists]

Re: Counting hits - revisited

2004-06-05 17:22:43
[repaired topposting]

Toen wij fleet(_at_)teachout(_dot_)org kietelden, kwam er dit uit:
Ruud:
fleet:

I'd like to be shown a "procmail" way to maintain my counters.
Shelling out to update the counter for every recipe that gets
activated does eat up resources.

Write a dot to the specific file and the filesize is your counter.

Or write the Message-ID (+NL) to the file, and use wc -l to count
the lines.

You can use LOG= to append to a file.

I may be the most clueless person you know of Ruud; but not one of those
statements make any sense at all to me. I must not be saying things
right.

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

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

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

'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

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

See also 'man wc'.

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