Take the 2-minute tour ×

Currently I use a script to put an image on the target server:

dd if=100mb.bin | ssh backup-server "dd of=/home/backupvps/blaa/100mb.bin"

However, how can I retrieve this very same file? I'd rather not use any FTP or Web server, but native commands.

share|improve this question
If ssh works, you should be able to use scp. –  Max Alginin Mar 14 '12 at 20:01

3 Answers 3

up vote 3 down vote accepted

If for some reason scp doesn't work for this purpose, you can simply:

ssh backup-server 'cat /home/backupvps/blaa/100mb.bin' > 100mb.bin
share|improve this answer
Thanks, using this right now! I prefer this over scp as I can pipe it through to lzop. ;-) –  Devator Mar 14 '12 at 21:07
You can always use scp -o Compression=yes -o CompressionLevel=9 to get gzip at the transport level. –  Daniel Pittman Mar 14 '12 at 21:22
@DanielPittman Absolutely. In this case, though, lzop might have some advantages over the built-in gzip capability for certain types of connections, so something like ssh backup-server 'cat somefile | lzop' | lzop -d - > somefile might be very useful. For bonus points, work pv into it somewhere. Similarly, for very small connections with beefy boxen at either end, I've been known to pipe through bzip2/bzcat. –  BMDan Mar 15 '12 at 14:36

As Max Alginin says, scp should work fine:

scp user@backup-server:/home/backupvps/blaa/100mb.bin /some/location/here/

I'd look into rsync though; uses a delta transfer algorithm, more efficient.

share|improve this answer
rsync will still be slow for the first time. –  Shyam Sundar C S Mar 14 '12 at 20:09

A lightweight option is to use netcat. ( Illustration )

share|improve this answer

Your Answer


