Tar Pipe

Posted 9 months, 1 week ago at 5:34 pm. 3 comments

We just got our second internal dev machine up yesterday rockin’ Ubuntu’s server flavor and we’re working on tearing down the current dev machine. A few other guys in the office and myself just finished our own Saw marathon, so we aptly named the new dev box jigsaw. Since the old dev machine has etched its self into our minds as being slow, with an svn commit often going into the night and on to the morning (just kidding), we’ve decided to rename it puzzle.

One problem, we have gigabytes of content from various home directories we need to transfer off of the machine and onto the new one before wiping it clean and giving it a new OS. A quick and dirty method for transferring tons of data from one machine to another is to use netcat and tar. It’s called a tar pipe.

On the receiving machine run the command:
netcat -l -p 7777 | tar filename

On the sending machine run the command:
tar cf - * | netcat recieving.hostname 7777

You won’t know when things are finished so you’ll probably want to keep a good eye on top or network activity. there you have it! A quick and easy method for transferring tons of data over ethernet between two machines.

3 Replies

  1. A better way to do this would be to use rsync. It will allow you to transfer to the other box with compression, optional SSH for security, live progress, transfer speed, and many other things; such as retaining permissions, and not following symlinks and excluding things. Check it out.. It’s very easy to use.

  2. And you plan to transfer gigs of data over through, using that ?

  3. the CPU is faster than the NIC.. next time compress your content before transfering since pipes, by definition, can be nested :)


Leave a Reply