aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2012-06-15 20:27:31 +0200
committerintrigeri <intrigeri@boum.org>2012-06-15 20:30:25 +0200
commit29dcdbae919787978fafd41a12d48338958e92f9 (patch)
treef7d078179c930b6dd13ad28bf878b53e6effb91a
parent1b48bc44445cba33a748bb8ad2833d7e2187d1ad (diff)
downloadbackupninja-29dcdbae919787978fafd41a12d48338958e92f9.tar.gz
backupninja-29dcdbae919787978fafd41a12d48338958e92f9.tar.bz2
Run rsync command-line through a shell, so that single-quotes around excludes are interpreted (Closes: #677410)
When --exclude 'something' is passed directly to rsync without going through a shell, rsync tries to match a file whose name contains single quotes, which is definitely not what we want it to do: exclude arguments protected with single quotes are meant to be passed to a shell.
-rw-r--r--handlers/rsync.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/handlers/rsync.in b/handlers/rsync.in
index 2620c47..f0df52f 100644
--- a/handlers/rsync.in
+++ b/handlers/rsync.in
@@ -1116,9 +1116,9 @@ 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
+ debug $nice $rsync ${rsync_options[@]} $filelist_flag $excludes $batch_option $orig $dest_path
set_pipefail
- $nice $rsync "${rsync_options[@]}" $filelist_flag "$excludes" $batch_option $orig $dest_path | tee -a $log
+ $nice su -c "$rsync ${rsync_options[@]} --delete-excluded $filelist_flag $excludes $batch_option $orig $dest_path" | tee -a $log
if [ "$?" != "0" ]; then
fatal "Rsync error when trying to transfer $SECTION"