aboutsummaryrefslogtreecommitdiff
path: root/files/handlers/rsync
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-12-24 11:36:39 -0200
committerSilvio Rhatto <rhatto@riseup.net>2011-12-24 11:36:39 -0200
commit60a0245da2b80753d5ae288f3a1ea3969fa81fc3 (patch)
tree7c4faf01c505bda00b4b27ff33930f5119e84262 /files/handlers/rsync
parentf5a590b81260dc046d0247da455f1b3594c31f58 (diff)
downloadpuppet-backup-60a0245da2b80753d5ae288f3a1ea3969fa81fc3.tar.gz
puppet-backup-60a0245da2b80753d5ae288f3a1ea3969fa81fc3.tar.bz2
Including recent rsync handler changes
Diffstat (limited to 'files/handlers/rsync')
-rw-r--r--files/handlers/rsync19
1 files changed, 13 insertions, 6 deletions
diff --git a/files/handlers/rsync b/files/handlers/rsync
index 9da6d92..471c8ba 100644
--- a/files/handlers/rsync
+++ b/files/handlers/rsync
@@ -176,7 +176,7 @@ function eval_config {
getconf include
getconf exclude
getconf exclude_vserver
- getconf numericids 0
+ getconf numericids
getconf compress 0
# dest section
@@ -217,7 +217,7 @@ function eval_config {
fi
fi
- getconf numericids 0
+ getconf numericids
getconf compress 0
# services section
@@ -914,7 +914,7 @@ function set_rsync_options {
if [ "$from" == "local" ] || [ "$dest" == "local" ]; then
# rsync options for local sources or destinations
- rsync_options=($rsync_options)
+ true
fi
if [ "$from" == "remote" ] || [ "$dest" == "remote" ]; then
@@ -933,8 +933,6 @@ function set_rsync_options {
remote_rsync="$remote_rsync --fake-super"
fi
- rsync_options=($rsync_options --rsync-path="$remote_rsync")
-
if [ "$protocol" == "ssh" ]; then
if [ ! -e "$id_file" ]; then
fatal "SSH Identity file $id_file not found"
@@ -948,6 +946,14 @@ function set_rsync_options {
fi
+ # Mangle rsync_options so we can use quotes after all other
+ # options were evaluated.
+ if [ "$from" == "local" ] && [ "$dest" == "local" ]; then
+ rsync_options=($rsync_options)
+ else
+ rsync_options=($rsync_options --rsync-path="$remote_rsync")
+ fi
+
include_vservers
}
@@ -1095,7 +1101,8 @@ for SECTION in $include; do
$nice $rsync "${rsync_options[@]}" $filelist_flag $excludes $batch_option $orig $dest_path | tee -a $log
if [ "$?" != "0" ]; then
- warning "Rsync error when trying to transfer $SECTION"
+ fatal "Rsync error when trying to transfer $SECTION"
+ exit 1
fi
update_metadata