From 60a0245da2b80753d5ae288f3a1ea3969fa81fc3 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 24 Dec 2011 11:36:39 -0200 Subject: Including recent rsync handler changes --- files/handlers/rsync | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'files/handlers/rsync') 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 -- cgit v1.2.3