2011-05-26 12:19:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-02-08 23:30:06 +00:00
|
|
|
set -e
|
|
|
|
|
2011-05-26 12:19:44 +00:00
|
|
|
# mac homedir backup script.
|
|
|
|
# by jeffrey paul <sneak@datavibe.net>
|
|
|
|
# 5539 AD00 DE4C 42F3 AFE1 1575 0524 43F4 DF2A 55C2
|
|
|
|
# see README
|
|
|
|
|
2013-12-29 02:17:42 +00:00
|
|
|
BACKUPDEST=${BACKUPDEST:-"sftp://sneak@datavibe.net/backup"}
|
|
|
|
|
|
|
|
PASSPHRASEFILE="${HOME}/Documents/Secure/backup-password.txt"
|
2014-02-08 23:30:06 +00:00
|
|
|
if [ -r "$PASSPHRASEFILE" ]; then
|
|
|
|
export PASSPHRASE="$(cat $PASSPHRASEFILE)"
|
|
|
|
else
|
|
|
|
echo "$0 error: unable to read passphrase from file!" > /dev/stderr
|
|
|
|
exit 127
|
|
|
|
fi
|
2013-05-14 22:24:10 +00:00
|
|
|
|
2014-02-08 23:30:06 +00:00
|
|
|
OPTS=""
|
2013-05-14 22:24:10 +00:00
|
|
|
OPTS+=" -v 5"
|
2014-02-08 23:30:06 +00:00
|
|
|
OPTS+=" --volsize 100"
|
2014-01-30 06:26:35 +00:00
|
|
|
#OPTS+=" --asynchronous-upload"
|
|
|
|
#OPTS+=" --allow-source-mismatch"
|
2014-02-08 23:30:06 +00:00
|
|
|
|
|
|
|
EXTRA=" --exclude-globbing-filelist ${HOME}/.local/etc/duplicity.exclude"
|
|
|
|
EXTRA+=" --exclude ${HOME}/Pictures/Aperture?Library.aplibrary"
|
|
|
|
EXTRA+=" --exclude ${HOME}/Documents/Dropbox"
|
|
|
|
SRC="${HOME}"
|
|
|
|
duplicity $DUPLICITY_ARGS $EXTRA $OPTS $RE $SRC $BACKUPDEST/home/
|
|
|
|
|
|
|
|
SRC="${HOME}/Pictures/Aperture?Library.aplibrary"
|
|
|
|
EXTRA=""
|
|
|
|
EXTRA+=" --exclude $SRC/Thumbnails"
|
|
|
|
EXTRA+=" --exclude $SRC/Previews"
|
|
|
|
duplicity $DUPLICITY_ARGS $EXTRA $OPTS $RE $SRC $BACKUPDEST/aperture/
|
|
|
|
|
|
|
|
EXTRA=""
|
|
|
|
SRC="${HOME}/Documents/Dropbox"
|
|
|
|
duplicity $DUPLICITY_ARGS $EXTRA $OPTS $RE $SRC $BACKUPDEST/dropbox/
|
|
|
|
|
|
|
|
EXTRA="
|
|
|
|
--exclude-globbing-filelist
|
|
|
|
${HOME}/.local/etc/duplicity.applications.exclude
|
|
|
|
"
|
|
|
|
SRC="/Applications"
|
|
|
|
duplicity $DUPLICITY_ARGS $EXTRA $OPTS $RE $SRC $BACKUPDEST/apps/
|