procmail
[Top] [All Lists]

Re: locking two files in one recipe

1997-04-25 01:32:00
On Thu, 24 Apr 1997 20:39:10 -0700 (PDT),
MAILBOX <dnhunt(_at_)rain(_dot_)org> wrote:
I have a recipe that writes to two different files in different
directories, and I need to lock them both. 
<...>
Can more than one lockfile be designated? 

Check out the LOCKFILE special variable. 

     :0 chiw: "$FILE.lock"
     | echo ; echo "$FROM" >> "$FILE" ; \
     sort -bdfu "$FILE" -o "$FILE" ; \
     echo "$DATA" >> "$LOG"

Try this:

    LOCKFILE="$LOG$LOCKEXT"

    :0 chiw: "$FILE$LOCKEXT"
    | echo; echo "$FROM" >>"$FILE"; \
      sort -bdfu "$FILE" -o "$FILE"; \
      echo "$DATA" >>"$LOG"

    LOCKFILE=

What's the first echo for? And are you really locking Procmail's log
file? (I don't think it's dangerous, but I also don't think Procmail
itself will honor the lock.)

Hope this helps,

/* era */

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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