hacks/osxbackup/backup.command

31 lines
836 B
Plaintext
Raw Normal View History

2011-05-26 12:19:44 +00:00
#!/bin/bash
# mac homedir backup script.
# by jeffrey paul <sneak@datavibe.net>
# 5539 AD00 DE4C 42F3 AFE1 1575 0524 43F4 DF2A 55C2
# see README
NOW="`date +%Y%m%d.%H%M%S`"
2013-12-29 02:17:42 +00:00
BACKUPDEST=${BACKUPDEST:-"sftp://sneak@datavibe.net/backup"}
PASSPHRASEFILE="${HOME}/Documents/Secure/backup-password.txt"
export PASSPHRASE="$(cat $PASSPHRASEFILE)"
2013-05-14 22:24:10 +00:00
OPTS+=" -v 5"
OPTS+=" --exclude-globbing-filelist ${HOME}/.local/etc/duplicity.exclude"
2013-12-29 02:17:42 +00:00
OPTS+=" --volsize 100"
2013-05-14 22:24:10 +00:00
OPTS+=" --asynchronous-upload"
2013-08-13 06:42:47 +00:00
OPTS+=" --allow-source-mismatch"
2013-12-29 02:17:42 +00:00
GPGOPTS="--compress-algo=bzip2 --bzip2-compress-level=9"
2013-08-13 06:42:47 +00:00
if [ "$1" == "--verify" ]; then
2013-12-29 02:17:42 +00:00
time \
duplicity --gpg-options '$GPGOPTS' \
verify $OPTS $BACKUPDEST ${HOME}/
2013-08-13 06:42:47 +00:00
else
2013-12-29 02:17:42 +00:00
time \
duplicity --gpg-options "$GPGOPTS" \
$EXTRADUPLICITY $OPTS $RE ${HOME}/ $BACKUPDEST
2013-08-13 06:42:47 +00:00
fi