Skip to content

Instantly share code, notes, and snippets.

@mad4j
Last active February 26, 2016 07:18
Show Gist options
  • Save mad4j/dbb0d2ad5a9320485b47 to your computer and use it in GitHub Desktop.
Save mad4j/dbb0d2ad5a9320485b47 to your computer and use it in GitHub Desktop.
use tar command through network over ssh session
#from local to remote with local compression
#(less bandwidth, more local processing)
tar zcvf - /home/app | ssh root@192.168.1.1 "cat > /tmp/backup.tar.gz"
#from local to remote with remote compression
#(more bandwidth, less local processing)
tar cvf - /home/app | ssh root@192.168.1.1 "gzip > /tmp/backup.tar.gz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment