From f01c5c1e3ea4a1c6060f87e6883062c25f8b13aa Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 10 May 2012 17:23:34 -0300 Subject: [PATCH 1/3] Merge branches 'master' and 'bug/3838' into bug/3838 From 5af9b963715efa186feacd0314a793184cc0eea3 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 10 May 2012 17:25:34 -0300 Subject: [PATCH 2/3] Removing duplicated locking support (#3838) --- handlers/rsync.in | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/handlers/rsync.in b/handlers/rsync.in index 884a885..3378819 100644 --- a/handlers/rsync.in +++ b/handlers/rsync.in @@ -39,7 +39,6 @@ # keepdaily = for long storage format, specify the number of daily backup increments # keepweekly = for long storage format, specify the number of weekly backup increments # keepmonthly = for long storage format, specify the number of monthly backup increments -# lockfile = lockfile to be kept during backup execution # nicelevel = rsync command nice level # enable_mv_timestamp_bug = set to "yes" if your system isnt handling timestamps correctly # tmp = temp folder @@ -129,7 +128,6 @@ function eval_config { getconf keepdaily 5 getconf keepweekly 3 getconf keepmonthly 1 - getconf lockfile getconf nicelevel 0 getconf enable_mv_timestamp_bug no getconf tmp /tmp @@ -875,45 +873,6 @@ function test_connect { } -function set_lockfile { - - if [ ! -z "$lockfile" ]; then - mkdir -p `dirname $lockfile` - if ( set -o noclobber; echo "$$" > "$lockfile" ) &> /dev/null; then - trap 'unset_lockfile' INT TERM EXIT - else - fatal "Could not create lockfile $lockfile, exiting" - fi - fi - -} - -function unset_lockfile { - - if [ ! -z "$lockfile" ]; then - $rm -f $lockfile || warning "Could not remove lockfile $lockfile" - fi - -} - -function check_lockfile { - - local pid process - - if [ ! -z "$lockfile" ] && [ -f "$lockfile" ]; then - pid="`cat $lockfile`" - process="`ps --no-headers -o comm $pid`" - if [ "$?" == "0" ] && [ "`ps --no-headers -o comm $$`" == "$process" ]; then - info "Another backup is running for $lockfile, skipping run" - exit - else - info "Found old lockfile $lockfile, removing it" - unset_lockfile - fi - fi - -} - function set_filelist { filelist_flag="" @@ -1103,8 +1062,6 @@ function end_mux { # the backup procedure eval_config -check_lockfile -set_lockfile set_rsync_options start_mux stop_services @@ -1136,7 +1093,6 @@ done mount_ro run_fsck start_services -unset_lockfile end_mux echo "Finnishing backup at `date`" >> $log From a99421620f829c039324b71c88460eaf20c94c7c Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 10 May 2012 17:34:15 -0300 Subject: [PATCH 3/3] Removing lockfile from rsync example (#3838) --- examples/example.rsync | 5 ----- 1 file changed, 5 deletions(-) diff --git a/examples/example.rsync b/examples/example.rsync index a2795db..faba203 100644 --- a/examples/example.rsync +++ b/examples/example.rsync @@ -50,11 +50,6 @@ days = 7 # for long storage format, specify the number of monthly backup increments #keepmonthly = 1 -# use this if you need a lockfile to be kept during backup execution -# this is an useful feature in case you have some tasks that should -# know if the backup is running or not -#lockfile = - # rsync command nice level #nicelevel = 0