Last active
August 29, 2015 14:24
-
-
Save whyvez/2d3a5936ea4a9d7eda10 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SERVER=yourwebsite.com | |
tar -cjf- ~/.crypt/passwd ~/.ssh ~/.bashrc ~/.profile ~/.vimrc ~/.gitconfig \ | |
~/.config/chromium ~/.mozilla \ | |
| openssl enc -aes-256-cbc \ | |
| ssh $SERVER 'cat>~/www/backup/`date +%F.%T`' | |
ssh $SERVER 'ls -1 ~/www/backup | grep ^[0-9] | sort > ~/www/backup/list.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WEB=http://yourwebsite.com/whatever | |
f=`curl -s $WEB/list.txt | tail -n1` | |
d=restore-`date +%F.%T` | |
mkdir $d | |
curl -s "$WEB/$f" \ | |
| openssl enc -d -aes-256-cbc \ | |
| tar -C "$d" -xjf- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment