1
0

add backup

This commit is contained in:
Jeff Vandrew Jr
2019-03-25 11:08:52 -04:00
parent a58688f77c
commit 77bdee9443
133 changed files with 184354 additions and 0 deletions

26
backup.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root."
echo "Use the command 'sudo su -' (include the trailing hypen) and try again"
exit 1
fi
(return 2>/dev/null) && sourced=1 || sourced=0
if [ $sourced != 1 ]; then
echo "You forgot the leading '.' followed by a space!"
echo "Try this format: . ./backup.sh"
exit 1
fi
if [ -z ${BACKUP_PROVIDER+x} ]; then
echo "Set BACKUP_PROVIDER environmental variable and try again."
exit 1
elif [ ${BACKUP_PROVIDER="Dropbox"} ]; then
btcpay-down.sh
tar -cvzf $PWD/dropbox-script/backup.tar.gz --exclude='/var/lib/docker/volumes/generated_bitcoin_datadir/*' /var/lib/docker
btcpay-up.sh
cd dropbox-script
./dropbox-script && rm backup.tar.gz
fi