procmail
[Top] [All Lists]

Re: About locking

2010-02-10 14:10:54
On Fri, 5 Feb 2010, Harry Putnam wrote:

I have a rule that collects the headers from mail and writes them to a
file.

I want to trim this file periodically by way of a perl script and cron
job.

But not sure how to guarantee that I'm not interfering with a write
coming from procmail, or allowing procmail to interfere with the perl
scripts rewrite of the file.


man lockfile

The idea is to use the same lockfile as your procmail recipe uses, whether it be for a mailbox or some other file

I use it in a bash script although I can't remember whether I actually checked whether

 lockfile "${THE_MAILBOX}.lock" "${THE_MAILBOX_TMP}.lock"

actually expands to the mailbox I'm trying to lock, such as IN.procmail. It's non critical for me though.

--
Alan

____________________________________________________________
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

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