projects
/
rrq
/
buckap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
split off a debian branch for deb packaging
[rrq/buckap.git]
/
duplicity-daily
diff --git
a/duplicity-daily
b/duplicity-daily
index ce659ceccafaa026545354ed23f71a804f982d76..22320920b28cf06c62d651342ba8b4a7429e1740 100755
(executable)
--- a/
duplicity-daily
+++ b/
duplicity-daily
@@
-20,6
+20,17
@@
TARGET="$(grep ^TARGET= -m1 $CONFIG | sed 's/^TARGET=//')"
# /opt/other/x=user@host/backup/x
SRCS=( $(grep ^/ $CONFIG) )
# /opt/other/x=user@host/backup/x
SRCS=( $(grep ^/ $CONFIG) )
+
+# add --exlude option for any path of $SRCS that extends $1
+excludes() {
+ local SRC X
+ for SRC in "${SRCS[@]}" ; do
+ SRC=${SRC%%=*}
+ [ "$SRC" = "$1" ] && continue
+ [ -z "${SRC%$1*}" ] && echo -n " --exclude $SRC"
+ done
+}
+
for SRC in "${SRCS[@]}" ; do
if [ "${SRC#*=}" = "$SRC" ] ; then
DST=$TARGET$SRC
for SRC in "${SRCS[@]}" ; do
if [ "${SRC#*=}" = "$SRC" ] ; then
DST=$TARGET$SRC
@@
-28,5
+39,6
@@
for SRC in "${SRCS[@]}" ; do
SRC="${SRC%%=*}"
fi
echo "** Backing up $SRC to $DST"
SRC="${SRC%%=*}"
fi
echo "** Backing up $SRC to $DST"
- dupltool ${OPTIONS[*]} $SRC pexpect+scp://$DST
+ echo dupltool $(excludes "$SRC") ${OPTIONS[*]} $SRC pexpect+scp://$DST
+ dupltool $(excludes "$SRC") ${OPTIONS[*]} $SRC pexpect+scp://$DST
done |& logger -t backup
done |& logger -t backup