]> gitweb.fluxo.info Git - backupninja.git/commitdiff
Quoting $exclude and $excludes and avoiding a for loop on $exclude to not expand...
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 13 Apr 2012 00:29:57 +0000 (21:29 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 13 Apr 2012 00:29:57 +0000 (21:29 -0300)
handlers/rsync.in

index e253c5cb34f86e95e6ea3a6404665ea5628b8412..a77da2a0c80c02f456bc30c3905d4a9de7f12d50 100644 (file)
@@ -277,9 +277,7 @@ function eval_config {
     mv=move_files
   fi
 
-  for path in $exclude; do
-    excludes="$excludes --exclude=$path"
-  done
+  excludes=`echo "$exclude" | sed -e 's/^/--exclude=/g' -e 's/ / --exclude=/g'`
 
 }
 
@@ -1113,8 +1111,8 @@ for SECTION in $include; do
   set_dest
 
   info "Syncing $SECTION on $dest_path..."
-  debug $nice $rsync "${rsync_options[@]}" $filelist_flag $excludes $batch_option $orig $dest_path
-  $nice $rsync "${rsync_options[@]}" $filelist_flag $excludes $batch_option $orig $dest_path | tee -a $log
+  debug $nice $rsync "${rsync_options[@]}" $filelist_flag "$excludes" $batch_option $orig $dest_path
+  $nice $rsync "${rsync_options[@]}" $filelist_flag "$excludes" $batch_option $orig $dest_path | tee -a $log
 
   if [ "$?" != "0" ]; then
     fatal "Rsync error when trying to transfer $SECTION"