3 # Backup directories daily. Configuration at /etc/duplicity-daily
6 [ -x /usr/bin/dupltool ] || exit 0
8 CONFIG=/etc/duplicity-daily.conf
9 grep -q ^ENABLE=yes $CONFIG || exit 0
11 # Detail backup options
12 OPTIONS=( $(grep ^OPTIONS= $CONFIG | sed 's/^OPTIONS=//') )
14 # The default backup target
15 TARGET="$(grep ^TARGET= -m1 $CONFIG | sed 's/^TARGET=//')"
17 # Backup lines start with full path, optionally with =target
18 # No spaces in pathname or target, e.g.
20 # /opt/other/x=user@host/backup/x
22 SRCS=( $(grep ^/ $CONFIG) )
23 for SRC in "${SRCS[@]}" ; do
24 if [ "${SRC#*=}" = "$SRC" ] ; then
30 echo "** Backing up $SRC to $DST"
31 dupltool ${OPTIONS[*]} $SRC pexpect+scp://$DST
32 done |& logger -t backup