]> git.etc.gen.nz Git - etc-obnam.git/commitdiff
Put in locking so we don't get obnam running multiple times.
authorAndrew Ruthven <andrew@etc.gen.nz>
Tue, 22 Oct 2013 12:40:23 +0000 (01:40 +1300)
committerAndrew Ruthven <andrew@etc.gen.nz>
Tue, 22 Oct 2013 12:40:23 +0000 (01:40 +1300)
run-backup

index 4c5d30f04c430775efa370f7b1c5898450c19e80..359c8d35d654246fcc38da7adf547ae720f7fd2e 100755 (executable)
@@ -91,7 +91,15 @@ if ( check_host 'AAAA' -o check_host 'A'  )
 then
   capture_debconf_info
 
+  if ! lockfile -r20 /var/lock/etc-obnam 
+  then
+    echo Failed to obtain local lock
+    exit
+  fi
+
   obnam --quiet --client-name=$CLIENT backup $WORKDIR $SOURCE
+
+  rm /var/lock/etc-obnam
   exit 0
 else
   echo huh, where is it?