{"id":953,"date":"2015-04-13T18:50:29","date_gmt":"2015-04-13T22:50:29","guid":{"rendered":"http:\/\/blog.alanporter.com\/?p=953"},"modified":"2015-04-13T18:50:29","modified_gmt":"2015-04-13T22:50:29","slug":"fast-copy","status":"publish","type":"post","link":"https:\/\/alanporter.com\/blog\/2015\/04\/13\/fast-copy\/","title":{"rendered":"tar + netcat = very fast copy"},"content":{"rendered":"<p>I reformatted a hard disk this weekend.  In the process, I needed to copy a bunch of files from one machine to the other.  Since both of these machines were smaller embedded devices, neither one of them had very capable CPUs.  So I wanted to copy all of the files without compression or encryption.<\/p>\n<p>Normally, I would use &#8220;<code>rsync -avz --delete --progress user@other:\/remote\/path\/ \/local\/path\/<\/code>&#8220;, but this does both compression (-z) and encryption (via rsync-over-ssh).<\/p>\n<p>Here&#8217;s what I ended up with.  It did not disappoint.<\/p>\n<p>Step 1 &#8211; On the machine being restored:<\/p>\n<pre>box1$ netcat -l -p 2020 | tar --numeric-owner -xvf -<\/pre>\n<p>Step 2 &#8211; On the machine with the backup:<\/p>\n<pre>box2$ tar --numeric-owner -cvf - | netcat -w3 box1 2020<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I reformatted a hard disk this weekend. In the process, I needed to copy a bunch of files from one machine to the other. Since both of these machines were smaller embedded devices, neither one of them had very capable CPUs. So I wanted to copy all of the files without compression or encryption. Normally, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5,15],"tags":[],"class_list":["post-953","post","type-post","status-publish","format-standard","hentry","category-software","category-geek","category-tips-tricks","count-0","even alt","author-alan","last"],"_links":{"self":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts\/953","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/comments?post=953"}],"version-history":[{"count":0,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts\/953\/revisions"}],"wp:attachment":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/media?parent=953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/categories?post=953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/tags?post=953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}