aboutsummaryrefslogtreecommitdiff
path: root/handlers
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-04-12 21:29:57 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-04-12 21:29:57 -0300
commitaa8d0f864830036e12e52696243c05df76d678e2 (patch)
treee393cb83937d6044b8e0688877d9344e6fca335b /handlers
parent1f367b40cdb0c790b9c3a1e45fceb4ee79e93c31 (diff)
downloadbackupninja-aa8d0f864830036e12e52696243c05df76d678e2.tar.gz
backupninja-aa8d0f864830036e12e52696243c05df76d678e2.tar.bz2
Quoting $exclude and $excludes and avoiding a for loop on $exclude to not expand wildcards in beforehand (upstream #3882)
Diffstat (limited to 'handlers')
-rw-r--r--handlers/rsync.in8
1 files changed, 3 insertions, 5 deletions
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"