Skip to content

Instantly share code, notes, and snippets.

@droptableuser
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save droptableuser/6b1868ed1fcc702d1ffe to your computer and use it in GitHub Desktop.
Save droptableuser/6b1868ed1fcc702d1ffe to your computer and use it in GitHub Desktop.
store backups on an untrusted share
#!/bin/bash
cd /backup/snapshot
for i in $(ls -A)
do
cd $i
ssh backup@$i \ 'tar zcf - /etc /opt' | gpg -e -r backup > $i.tar.gz
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment