]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Rsync handler patch from upstream #8196 (3)
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 7 Nov 2014 17:10:50 +0000 (15:10 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 7 Nov 2014 17:10:50 +0000 (15:10 -0200)
files/handlers/rsync

index 2b55c61d704778917157be1b9a4b7413785ab734..f57cb5c54407b83e6b7fa8bf76fae452418de58a 100644 (file)
@@ -735,25 +735,24 @@ function move_files {
 
 function prepare_storage {
 
-  if [ "$test" ]; then
-    return
-  fi
-
   section="`basename $SECTION`"
 
   if [ "$format" == "short" ]; then
 
     suffix="$section.0"
-    info "Rotating $backupdir/$SECTION..."
-    echo "Rotating $backupdir/$SECTION..." >> $log
 
-    if [ "$dest" == "remote" ]; then
-      rotate_short_remote $backupdir/$SECTION/$section $keep
-    else
-      rotate_short $backupdir/$SECTION/$section $keep
-      if [ ! -d "$backupdir/$SECTION/$section.0" ]; then
-        mkdir -p $backupdir/$SECTION/$section.0
-      fi
+    if [ ! "$test" ]; then
+       info "Rotating $backupdir/$SECTION..."
+       echo "Rotating $backupdir/$SECTION..." >> $log
+
+       if [ "$dest" == "remote" ]; then
+          rotate_short_remote $backupdir/$SECTION/$section $keep
+       else
+          rotate_short $backupdir/$SECTION/$section $keep
+          if [ ! -d "$backupdir/$SECTION/$section.0" ]; then
+             mkdir -p $backupdir/$SECTION/$section.0
+          fi
+       fi
     fi
 
   elif [ "$format" == "long" ]; then
@@ -769,15 +768,18 @@ function prepare_storage {
     fi
 
     suffix="$btype.1"
-    info "Rotating $backupdir/$SECTION/..."
-    echo "Rotating $backupdir/$SECTION/..." >> $log
 
-    if [ "$dest" == "remote" ]; then
-      rotate_long_remote $backupdir/$SECTION
-      setup_long_dirs_remote $backupdir/$SECTION $btype
-    else
-      rotate_long $backupdir/$SECTION
-      setup_long_dirs $backupdir/$SECTION $btype
+    if [ ! "$test" ]; then
+       info "Rotating $backupdir/$SECTION/..."
+       echo "Rotating $backupdir/$SECTION/..." >> $log
+
+       if [ "$dest" == "remote" ]; then
+          rotate_long_remote $backupdir/$SECTION
+          setup_long_dirs_remote $backupdir/$SECTION $btype
+       else
+          rotate_long $backupdir/$SECTION
+          setup_long_dirs $backupdir/$SECTION $btype
+       fi
     fi
 
   elif [ "$format" == "mirror" ]; then