On Thu, October 6, 2005 0:25, Dallman Ross said:
On Wed, Oct 05, 2005 at 04:42:20PM -0500, Mr Duck wrote:
Dallman Ross wrote:
in procmail, you'll need to be able to read in today's date from
a file. You could generate it once daily via cron. It would
contain, e.g.:
TODAY = 20051005
Would there really be that much of a performance hit using:
TODAY = `date +"%Y%m%d"`
instead of reading from a file? After all, the recipe will
still have to spend some cycles loading the file data.
I just ran a test on my system to check this, and my results are:
Reading from a file 10,000 times takes 29 seconds.
Using the date command 10,000 times takes 33 seconds.
You're spawning a shell 10,000 times.
It's not a big hit. The date command is not heavy-duty.
But the OP asked very specifically, "is there an all-procmail
way?" Answer: yes.
Once you set up the cron job, you save a tiny bit every
day forever.
--
dman
And you can save even more cycles by having a script in the crontab to
rewrite the rc every day, so the date is actually a piece of text in the
file itself. ;-)
--
Francesco Peeters
----
GPG Key = AA69 E7C6 1D8A F148 160C D5C4 9943 6E38 D5E3 7704
If your program doesn't recognize my signature, please visit
http://www.CAcert.org/index.php?id=3 to retrieve the Root CA certificate.
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail