encrypted.sh (622B)
1 #!/bin/bash 2 3 # From a system with **full** backups of servers in /home/backup & $HOME/personal-files, encrypts both directories and sends them to the remote 4 5 mkdir -p $HOME/backups 6 7 rm $HOME/backups/hosts.tar.gpg || true 8 tar -cf $HOME/backups/hosts.tar /home/backup 9 gpg --batch --yes --passphrase $ENCRYPTION_PW -c $HOME/backups/hosts.tar 10 11 12 rm $HOME/backups/personal.tar.gpg || true 13 tar -cf $HOME/backups/personal.tar.gpg $HOME/personal-files 14 gpg --batch --yes --passphrase $ENCRYPTION_PW -c $HOME/backups/personal.tar.gpg 15 16 # scp $HOME/backups/personal.tar.gpg 17 # scp $HOME/backups/hosts.tar.gpg 18 19 # TODAY=$(date +%Y-%m-%d)