hacks/osxbackup/backup.command

37 lines
1.0 KiB
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"
2014-01-30 06:26:35 +00:00
#OPTS+=" --asynchronous-upload"
#OPTS+=" --allow-source-mismatch"
#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
2014-01-30 06:26:35 +00:00
echo "attempted backup to $BACKUPDEST"
if [ $? ]; then
echo "backup failed!" > /dev/stderr
exit 127
else
echo "Successfully completed backup to ${BACKUPDEST}."
fi
2013-08-13 06:42:47 +00:00
fi