aboutsummaryrefslogtreecommitdiff
path: root/files/handlers
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-01-05 11:20:06 -0200
committerSilvio Rhatto <rhatto@riseup.net>2015-01-05 11:20:06 -0200
commit284c4be3f70b907e3275cb15c7e0c37ccad51089 (patch)
treea7490702357f8e66ae0d88f64ffe9f354f98fbe5 /files/handlers
parentd6a0fffb130417efbb083dd55b1bc1f18233d05b (diff)
parent22d0f885bc9bed393bc27589afcc46f2cc647b5c (diff)
downloadpuppet-backup-284c4be3f70b907e3275cb15c7e0c37ccad51089.tar.gz
puppet-backup-284c4be3f70b907e3275cb15c7e0c37ccad51089.tar.bz2
Merge branch 'master' into feature/autoload
Diffstat (limited to 'files/handlers')
-rw-r--r--files/handlers/rsync44
1 files changed, 27 insertions, 17 deletions
diff --git a/files/handlers/rsync b/files/handlers/rsync
index 634f036..f57cb5c 100644
--- a/files/handlers/rsync
+++ b/files/handlers/rsync
@@ -740,16 +740,19 @@ function prepare_storage {
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
@@ -765,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
@@ -908,6 +914,10 @@ function set_filelist {
function set_rsync_options {
+ if [ "$test" ]; then
+ rsync_options="$rsync_options --dry-run"
+ fi
+
if [ "$numericids" != "0" ]; then
rsync_options="$rsync_options --numeric-ids"
fi