{"id":549,"date":"2011-01-28T00:30:38","date_gmt":"2011-12-21T21:51:50","guid":{"rendered":"http:\/\/kraftek.com\/blog\/remote-copy-files-using-ssh-and-tar\/"},"modified":"2025-03-18T13:20:54","modified_gmt":"2025-03-18T13:20:54","slug":"remote-copy-files-using-ssh-and-tar","status":"publish","type":"post","link":"\/blog\/index.php\/remote-copy-files-using-ssh-and-tar\/","title":{"rendered":"remote copy files using ssh and tar"},"content":{"rendered":"\n<p>to copy a whole directory from this server to another do: <\/p>\n\n\n\n<p>To push files:<br><br><code>cd \/dir\/to\/copy\/from; tar zpcf \u2013 * | ssh otherserver \u201c(cd \/dir\/to\/copy\/to &amp;&amp; tar zxvpf \u2013 )\u201d<\/code><\/p>\n\n\n\n<p>To pull files:<\/p>\n\n\n\n<p><code>ssh -C otherserver '(cd \/some\/dir &amp;&amp; tar zcf - *)' | (cd \/dest\/dir &amp;&amp; tar zxf -<\/code>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>to copy a whole directory from this server to another do: To push files: cd \/dir\/to\/copy\/from; tar zpcf \u2013 * | ssh otherserver \u201c(cd \/dir\/to\/copy\/to &amp;&amp; tar zxvpf \u2013 )\u201d To pull files: ssh -C otherserver &#8216;(cd \/some\/dir &amp;&amp; tar zcf &#8211; *)&#8217; | (cd \/dest\/dir &amp;&amp; tar zxf -)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-549","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=549"}],"version-history":[{"count":4,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/549\/revisions"}],"predecessor-version":[{"id":1672,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/549\/revisions\/1672"}],"wp:attachment":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=549"},{"taxonomy":"post_tag","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}