aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2011-07-19 00:24:18 +0200
committerintrigeri <intrigeri@boum.org>2011-07-19 00:24:18 +0200
commit52eb8d0c4b4b1d9f0777c6f0b9ff4d4a86858874 (patch)
treeccb8692c43f2a8d03e8071129cd1b35cb2286017
parent69c0ec09c5e5eb9e166bc0f5c9a1ef702d0150d6 (diff)
downloadbackupninja-52eb8d0c4b4b1d9f0777c6f0b9ff4d4a86858874.tar.gz
backupninja-52eb8d0c4b4b1d9f0777c6f0b9ff4d4a86858874.tar.bz2
Fix "Locking mechanism causes variable problem".
Thanks to Olivier Berger for the patch.
-rwxr-xr-xsrc/backupninja.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backupninja.in b/src/backupninja.in
index f6a5b0e..0400828 100755
--- a/src/backupninja.in
+++ b/src/backupninja.in
@@ -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`