procmail
[Top] [All Lists]

Re: Archiving mail

1997-11-13 12:08:57
era eriksson <era(_at_)iki(_dot_)fi> writes:

I don't do this myself, so this is basically off the top of my head
-- could be to create a file you INCLUDERC which contains whatever
date your most recent cron job created.  <snip>

Okay, assuming I want an .rc file that defines a TODAY variable with
MM.YY format, I write this:

#!/bin/sh
TODAY=`date +%m.%y`
PMDIR=$HOME/.procmail
echo "TODAY=$TODAY" >$PMDIR/date.rc

It outputs a file like this:

TODAY=11.97


What is to keep procmail from reading date.rc at the same time the
shell script is writing it out?  What's to keep procmail from seeing
something like this:

TO
-or-
TODAY=
-or-
TODAY=11.



I've often wondered about similar problems when saving my .procmailrc,
etc.  Is there something about Unix that keeps these things atomic?


-- 
matta

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