Skip to content

Instantly share code, notes, and snippets.

@whyvez
Last active August 29, 2015 14:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whyvez/2d3a5936ea4a9d7eda10 to your computer and use it in GitHub Desktop.
Save whyvez/2d3a5936ea4a9d7eda10 to your computer and use it in GitHub Desktop.
#!/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'
#!/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