Skip to content

Instantly share code, notes, and snippets.

@kennwhite
Created July 31, 2013 17:11
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 kennwhite/6124007 to your computer and use it in GitHub Desktop.
Save kennwhite/6124007 to your computer and use it in GitHub Desktop.
Push backup from remote box 1 to remote box 2 through local (box 1 has no direct access to box 2)
#!/bin/bash
# Push remote box 1 to remote box 2 through local box (box 1 has no access to box 2)
ssh -i box1key user@remotebox1 \
"tar -czvf - remotedir1" \
| ssh -i box2key user@remotebox2 "cat >remotedir2.tgz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment