Netcat + Tar for simple file transfers

This past week I spent 3 days watching a 3-thread sftp process transfer over a system backup of 53GB. This backup in particular had a ton of files and directories, and I suspect most of the actual time was spent querying and creating the files rather than the actual transfer itself. Now that everything is transferred over, I can rsync it against another machine, but that’s another story.

In searching for a better way than what I did, I found this cool gem:

On the sender:

tar cf - directory_to_copy | netcat other_host 7000

On the receiver:

netcat -l -p 7000 | tar x

[The Source](http://compsoc.dur.ac.uk/~djw/tarpipe.html)

Leave a Reply

Your email address will not be published. Required fields are marked *