encrypted-backup.sh (721B)
1 #!/bin/bash 2 3 set -e pipefail 4 5 source ~/.bashrc || true # TODO: Why does this fail? 6 7 # This should really never happen because of the above ~/.bashrc sourcing 8 if [[ -z "$ENCRYPTION_PW" ]]; then 9 echo "Encryption PW not set..." 10 exit 1 11 fi 12 13 NOW=$(date +%s) 14 umount -l $HOME/backup || true 15 16 sshfs root@andrew-1.selfhost.imbue.com:/home/host/.openhost/local_compute_space/app_archive/backup $HOME/backup 17 tar -czf - /home/backup | gpg -c --batch --yes --passphrase "$ENCRYPTION_PW" -o /home/andrew/backup/backup-$NOW.tar.gz.gpg 18 tar -czf - $HOME/personal-files | gpg -c --batch --yes --passphrase "$ENCRYPTION_PW" -o /home/andrew/backup/personal-files-$NOW.tar.gz.gpg 19 20 21 22 date | tee -a $HOME/logs/backup-encrypted-times.txt