Skip to content

Instantly share code, notes, and snippets.

@ralphtheninja
Last active August 29, 2015 14:24
Show Gist options
  • Save ralphtheninja/ae9603212e23529bb122 to your computer and use it in GitHub Desktop.
Save ralphtheninja/ae9603212e23529bb122 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