diff options
author | intrigeri <intrigeri@boum.org> | 2012-06-15 20:40:27 +0200 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2012-06-15 20:40:27 +0200 |
commit | edfe2adb85faef277283e65454ca533fde8f7e89 (patch) | |
tree | 545f1d278d6541fcba09091d196bd189ddc9d042 /handlers/rsync.in | |
parent | 13edaf0912f8b36d5035b5ebdbbc28fd0d498427 (diff) | |
parent | aae966981e259b11afc1e01b68d4fa7c59cde646 (diff) | |
download | backupninja-edfe2adb85faef277283e65454ca533fde8f7e89.tar.gz backupninja-edfe2adb85faef277283e65454ca533fde8f7e89.tar.bz2 |
Merge tag 'backupninja-1.0' into upstream
Releasing backupninja 1.0
Happy birthdays!
Diffstat (limited to 'handlers/rsync.in')
-rw-r--r-- | handlers/rsync.in | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/handlers/rsync.in b/handlers/rsync.in index 386255e..f0df52f 100644 --- a/handlers/rsync.in +++ b/handlers/rsync.in @@ -275,8 +275,15 @@ function eval_config { mv=move_files fi - excludes=`echo "$exclude" | @SED@ -e "s/^/--exclude='/g" -e "s/ /' --exclude='/g" -e "s/$/'/"` - + set -o noglob + SAVEIFS=$IFS + IFS=$(echo -en "\n\b") + for i in $exclude; do + str="${i//__star__/*}" + excludes="${excludes} --exclude='$str'" + done + IFS=$SAVEIFS + set +o noglob } function rotate_short { @@ -1109,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" |