aboutsummaryrefslogtreecommitdiff
path: root/handlers
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2012-06-15 20:21:09 +0200
committerintrigeri <intrigeri@boum.org>2012-06-15 20:21:09 +0200
commitf7488968c0ab80b923927cc8bf6376fd28fd5022 (patch)
treee5a00f0e25c5537b65b9c22de35420f4b5cd7c3c /handlers
parentcd3abeab358e1a13bd6c14002b2feb5558b9a6a1 (diff)
downloadbackupninja-f7488968c0ab80b923927cc8bf6376fd28fd5022.tar.gz
backupninja-f7488968c0ab80b923927cc8bf6376fd28fd5022.tar.bz2
rsync: generate excludes command-line snippet the same way as the duplicity handler does.
The latter has a robust history wrt. dealing with excludes / glob / quoting etc., let's use that instead of the shiny new sed-based way.
Diffstat (limited to 'handlers')
-rw-r--r--handlers/rsync.in11
1 files changed, 9 insertions, 2 deletions
diff --git a/handlers/rsync.in b/handlers/rsync.in
index 386255e..c584e7f 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 {