backup now does apps, breaks out aperture and dropbox

This commit is contained in:
Jeffrey Paul 2014-02-09 00:30:06 +01:00
parent 89c948ea08
commit c0021efb13

View File

@ -1,36 +1,47 @@
#!/bin/bash #!/bin/bash
set -e
# mac homedir backup script. # mac homedir backup script.
# by jeffrey paul <sneak@datavibe.net> # by jeffrey paul <sneak@datavibe.net>
# 5539 AD00 DE4C 42F3 AFE1 1575 0524 43F4 DF2A 55C2 # 5539 AD00 DE4C 42F3 AFE1 1575 0524 43F4 DF2A 55C2
# see README # see README
NOW="`date +%Y%m%d.%H%M%S`"
BACKUPDEST=${BACKUPDEST:-"sftp://sneak@datavibe.net/backup"} BACKUPDEST=${BACKUPDEST:-"sftp://sneak@datavibe.net/backup"}
PASSPHRASEFILE="${HOME}/Documents/Secure/backup-password.txt" PASSPHRASEFILE="${HOME}/Documents/Secure/backup-password.txt"
export PASSPHRASE="$(cat $PASSPHRASEFILE)" if [ -r "$PASSPHRASEFILE" ]; then
export PASSPHRASE="$(cat $PASSPHRASEFILE)"
else
echo "$0 error: unable to read passphrase from file!" > /dev/stderr
exit 127
fi
OPTS=""
OPTS+=" -v 5" OPTS+=" -v 5"
OPTS+=" --exclude-globbing-filelist ${HOME}/.local/etc/duplicity.exclude" OPTS+=" --volsize 100"
#OPTS+=" --asynchronous-upload" #OPTS+=" --asynchronous-upload"
#OPTS+=" --allow-source-mismatch" #OPTS+=" --allow-source-mismatch"
#GPGOPTS="--compress-algo=bzip2 --bzip2-compress-level=9"
if [ "$1" == "--verify" ]; then EXTRA=" --exclude-globbing-filelist ${HOME}/.local/etc/duplicity.exclude"
time \ EXTRA+=" --exclude ${HOME}/Pictures/Aperture?Library.aplibrary"
duplicity --gpg-options '$GPGOPTS' \ EXTRA+=" --exclude ${HOME}/Documents/Dropbox"
verify $OPTS $BACKUPDEST ${HOME}/ SRC="${HOME}"
else duplicity $DUPLICITY_ARGS $EXTRA $OPTS $RE $SRC $BACKUPDEST/home/
time \
duplicity --gpg-options "$GPGOPTS" \ SRC="${HOME}/Pictures/Aperture?Library.aplibrary"
$EXTRADUPLICITY $OPTS $RE ${HOME}/ $BACKUPDEST EXTRA=""
echo "attempted backup to $BACKUPDEST" EXTRA+=" --exclude $SRC/Thumbnails"
if [ $? ]; then EXTRA+=" --exclude $SRC/Previews"
echo "backup failed!" > /dev/stderr duplicity $DUPLICITY_ARGS $EXTRA $OPTS $RE $SRC $BACKUPDEST/aperture/
exit 127
else EXTRA=""
echo "Successfully completed backup to ${BACKUPDEST}." SRC="${HOME}/Documents/Dropbox"
fi duplicity $DUPLICITY_ARGS $EXTRA $OPTS $RE $SRC $BACKUPDEST/dropbox/
fi
EXTRA="
--exclude-globbing-filelist
${HOME}/.local/etc/duplicity.applications.exclude
"
SRC="/Applications"
duplicity $DUPLICITY_ARGS $EXTRA $OPTS $RE $SRC $BACKUPDEST/apps/