{"id":180,"date":"2008-05-05T13:20:41","date_gmt":"2008-05-05T21:20:41","guid":{"rendered":"http:\/\/jim-zimmerman.com\/blog\/?p=180"},"modified":"2008-05-05T13:20:41","modified_gmt":"2008-05-05T21:20:41","slug":"using-tar-over-ssh","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=180","title":{"rendered":"Using tar over ssh."},"content":{"rendered":"<p>Backup to a remote file location using tar over ssh:<br \/>\ntar cvzf &#8211; \/localdirectory | ssh ssh root@remotehostname &#8220;dd of=\/remotefilename&#8221;<\/p>\n<p>Backup to a remote tape device using tar over ssh:<br \/>\ntar cvzf &#8211; \/localdirectory | ssh ssh root@remotehostname $(mt -f remotetapedevice rewind; dd of=\/remotetapedevice)$<\/p>\n<p>Restore from a remote file location using tar over ssh:<br \/>\ncd \/<br \/>\nssh root@remotehostname &#8220;dd if=\/remotefilename&#8221; | tar zxvf &#8211;<\/p>\n<p>Examples:<br \/>\nBackup:<br \/>\ntar cvzf &#8211; \/boot | ssh ssh root@thisis.myserver.name &#8220;dd of=\/backup\/boot.tar.gz&#8221;<br \/>\ntar cvzf &#8211; \/boot | ssh ssh root@thisis.myserver.name $(mt -f \/dev\/nrst0 rewind; dd of=\/dev\/nrst0)$<br \/>\nRestore:<br \/>\nssh root@thisis.myserver.name &#8220;dd if=\/boot.tar.gz&#8221; | tar zxvf &#8211;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Backup to a remote file location using tar over ssh: tar cvzf &#8211; \/localdirectory | ssh ssh root@remotehostname &#8220;dd of=\/remotefilename&#8221; Backup to a remote tape device using tar over ssh: tar cvzf &#8211; \/localdirectory | ssh ssh root@remotehostname $(mt -f remotetapedevice rewind; dd of=\/remotetapedevice)$ Restore from a remote file location using tar over ssh: cd [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-180","post","type-post","status-publish","format-standard","hentry","category-documentation"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=180"}],"version-history":[{"count":0,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/180\/revisions"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}