Skip to content

Instantly share code, notes, and snippets.

Last active Mar 12, 2016
What would you like to do?
backup and restore settings
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'
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