Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have an archive I need to transfer to a remote destination but the target drive is not big enough to hold both the compressed archive and the uncompressed files.

I wonder if there are some utilities which can decompress the archive as the data arrives, rather than having to receive the whole thing then decompress it.

netcat is what seems to show up in my searches but I am open to any alternatives.

share|improve this question
    
curl URL/FILE.tar.gz | tar xz ? –  golja Oct 19 '12 at 14:27

1 Answer 1

up vote 1 down vote accepted

On the sending side:

dd if=somefile.gz bs=32M |nc server 7000

On the receiving side:

nc -l -p 7000 | gzip -dfc|dd bs=32M of=somefile

or if it is a tar.gz

nc -l -p 7000 | gzip -dfc|tar -xvf -
share|improve this answer
    
I am trying to execute if over a secure connection via SSH. I first create a tunnel - ssh root@remote -L 7000:localhost:7000. But after I try to send via dd if=/archives/file.gz bs=32M | nc localhost 7000 on the local side, an error appera channel 3: open failed: connect failed: Connection refused. Any idea what it could be. I am doing some searching anyway –  vfclists Oct 19 '12 at 17:12
    
You have to first establish the receiving side and then the sender. –  Stone Oct 19 '12 at 19:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.