lockf command

2011-04-13 Thread Bastien Semene
Hi, I'm writing a (very simple) script to avoid concurrent processes to do the same task. Background: After a task is done by a service, it synchronizes it with other(s) server(s). I wish that if a synchronization is not done during one or more tasks are completed, not concurrent

Re: lockf command

2011-04-13 Thread Nikos Vassiliadis
On 4/13/2011 12:08 PM, Bastien Semene wrote: I wish that if command #2 can't acquire the lock, lockf exits (exit 0 would be nice). If I set -t 1, lockf is quite what I'm waiting for. But I like to do this in a clear way : if it can't acquire the lock it exits, no timeout wait. Am I

Re: lockf command

2011-04-13 Thread Admin Cyanide
Hi Nikos, I was stupid not to think about this... And it is a nice tip to use a new shell as a running process. However, I re-read the lockf man and saw : By default, lockf waits indefinitely to acquire the lock. Everything is clear now. Thanks ! Le 13/04/2011 15:23, Nikos Vassiliadis a