‘netcat’ : my best friend :)

For those of you who read this unpretentious blog, you must have noticed this week-end a maintenance window.

The DD of my hosting has crashed. To be more precise, it is crashing. His time to live is near to expire…

So to save my files on this server, a simple tar and scp is not enough. In fact, if you do this, you will create inodes and store on your FS. You will have lot of chance to have corrupted tarballs.

So I chose to use netcat to make my saves. tarballs are created on the fly on the network. So you only make reads on your DD, no creates.

On the device you have datas :

source# tar c your_folder | nc -q 10 -l -p 7777

 

On the remote end :

target# nc -w 10 source.domain.net 7777 > your_folder.tar

 

You can use the ‘z’ flag to gzip the archive. For more explaination, man is your friend, or in others words : RTFM…

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.