From: Silvio Rhatto Date: Fri, 13 Apr 2012 00:29:57 +0000 (-0300) Subject: Quoting $exclude and $excludes and avoiding a for loop on $exclude to not expand... X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=aa8d0f864830036e12e52696243c05df76d678e2;p=backupninja.git Quoting $exclude and $excludes and avoiding a for loop on $exclude to not expand wildcards in beforehand (upstream #3882) --- diff --git a/handlers/rsync.in b/handlers/rsync.in index e253c5c..a77da2a 100644 --- a/handlers/rsync.in +++ b/handlers/rsync.in @@ -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"