]> gitweb.fluxo.info Git - backupninja.git/commitdiff
Fix "Locking mechanism causes variable problem".
authorintrigeri <intrigeri@boum.org>
Mon, 18 Jul 2011 22:24:18 +0000 (00:24 +0200)
committerintrigeri <intrigeri@boum.org>
Mon, 18 Jul 2011 22:24:18 +0000 (00:24 +0200)
Thanks to Olivier Berger for the patch.

src/backupninja.in

index f6a5b0e9faf61372703dd2e260d8640cd97abc2d..040082844ee0dbbc17888c1d23496af8d130a11f 100755 (executable)
@@ -325,7 +325,7 @@ function process_action() {
 
    # start locked section : avoid concurrent execution of the same backup
    # uses a construct specific to shell scripts with flock. See man flock for details
-   (
+   {
        debug "executing handler in locked section controlled by $lockfile"
        flock -x -w 5 200
        # if all is good, we acquired the lock
@@ -352,7 +352,7 @@ function process_action() {
           debug "failed to acquire lock"
           echo "Fatal: Could not acquire lock $lockfile. A backup is probably already running for $file." >>$bufferfile
        fi
-   ) 200> $lockfile
+   } 200> $lockfile
    # end of locked section
 
    _warnings=`cat $bufferfile | grep "^Warning: " | wc -l`