]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Including recent rsync handler changes
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 24 Dec 2011 13:36:39 +0000 (11:36 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 24 Dec 2011 13:36:39 +0000 (11:36 -0200)
files/handlers/rsync

index 9da6d92174a7cdf5f43b06cbee1d9b7b5ecf5c25..471c8ba3b69325a1a49d0859a4414806f5d9ad33 100644 (file)
@@ -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