Created
January 16, 2014 18:36
-
-
Save jmillerdesign/8460671 to your computer and use it in GitHub Desktop.
Useful to move many files (thousands or millions files) over ssh. Faster than scp because this way you save a lot of tcp connection establishments (syn/ack packets).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tar -cf - relative/path/to/dir | gzip -c | ssh user@example.com 'cd ~/path/to/dir; tar xfz -' | |
# If using a fast lan (I have just tested gigabyte ethernet) it is faster to not compress the data so the command would be: | |
# tar -cf - relative/path/to/dir | ssh user@example.com 'cd ~/path/to/dir; tar xf -' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment