scp with compression.

scp -C 10.0.0.4:/tmp/backup.sql /path/to/backup.sql
-C is for compression.

10
By: OJM
2010-02-15 12:39:46
scp

2 Alternatives + Submit Alt

  • I've kept the gzip compression at a low level, but depending on the cpu power available on the source machine you may want to increase it. However, SQL compresses really well, and I found even with -1 I was able to transfer 40 MiB/s over a 100 mbps wire, which was good enough for me.


    3
    ssh 10.0.0.4 "cat /tmp/backup.sql | gzip -c1" | gunzip -c > backup.sql
    kennethjor · 2010-02-14 19:09:07 0
  • If you have servers on Wide Area Network (WAN), you may experience very long transfer rates due to limited bandwidth and latency. To speed up you transfers you need to compress the data so you will have less to transfer. So the solution is to use a compression tools like gzip or bzip or compress before and after the data transfer. Using ssh "-C" option is not compatible with every ssh version (ssh2 for instance).


    0
    ssh 10.0.0.4 "gzip -c /tmp/backup.sql" |gunzip > backup.sql
    ultips · 2012-01-06 17:44:06 0

What Others Think

You forgot to mention your OS. No such option in my ubuntu scp
zolden · 610 weeks and 1 day ago
The compress option is pretty standard. I have it available on Ubuntu 12.04, Linux Mint 13, FreeBSD 9.2 and 9.3
DaveQB · 364 weeks and 6 days ago
As I have beginning late gotten the information about the Canyon View Accommodation. I often visit http://www.prepositionchecker.com/10-examples-of-preposition-correction/ to read a useful info. I will pick it. I need to win this opposition.?
Ahmed74 · 27 weeks and 6 days ago
As I have beginning late gotten the information about the Canyon View Accommodation. Visit http://www.prepositionchecker.com/10-examples-of-preposition-correction/ for more ideas. I will pick it. I need to win this opposition.?
Ahmed74 · 27 weeks and 6 days ago
A colossal piece of the affecting individuals have made a cutoff among religion and themselves. One hire this homepage for more info. This thing is beating the division in our overall people.
Ahmed74 · 27 weeks and 6 days ago
An understudy online course program may be boggling to you considering the room and comfort it gives. Check this homepage for getting wonderful info. By a wide edge by far an enormous segment of individuals get squashed. In any case, it should be seen that web sorting out model isn't basic.
Ahmed74 · 27 weeks and 6 days ago
After quite a while, we are seeing the amazing update of Eternal DB. You can visit PassiveVoiceFixer.com for more details. This game will wind up being incredibly stupefying and stunning for us we when in doubt.
tinakutch · 22 weeks and 6 days ago
This looking at direct is covering the perspective of all conceivable Hotmail email login messes up which an individual can understanding. Try this www.plagerismchecker.net it will help you a lot. Accordingly, having this guide is proposed.
tinakutch · 22 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: