{"id":50,"date":"2005-12-07T01:38:57","date_gmt":"2005-12-07T04:38:57","guid":{"rendered":"http:\/\/www.sysop.ca\/?p=50"},"modified":"2018-10-01T06:30:26","modified_gmt":"2018-10-01T13:30:26","slug":"quick-and-dirty-remote-unix-backups","status":"publish","type":"post","link":"http:\/\/www.sysop.ca\/?p=50","title":{"rendered":"Quick and dirty remote unix backups"},"content":{"rendered":"<p>So you need to backup a remote unix system but don&#8217;t have enough free disk space to tar locally and then tranfer? Try this!<\/p>\n<p>ssh username@hostname.tld &#8220;tar -zcvf &#8211; \/ &#8211;exclude \/proc &#8211;exclude \/dev &#8221; | cat > my-system-backup.tgz<\/p>\n<p>This is a breakdown of what this does: <\/p>\n<p>&#8211; Starts an ssh session with your remote system (hostname.tld)<br \/>\n&#8211; Executes tar -zcvf &#8211; \/ &#8211;exclude \/proc &#8211;exclude \/dev ( the exclude statements ensure we don&#8217;t grab bits we don&#8217;t want, \/proc for sure)<br \/>\n&#8211; Since tar has &#8211; as the filename it pipes the output to the shell, which in turn is piped into cat<br \/>\n&#8211; The > redirects the output into a filename of your choice, the .tgz indicated Gzip&#8217;d tar file, you can name it whatever you like but .tgz is a standard.<\/p>\n<p>The above command will backup the entire system but you can specify any path, a simple . will backup all your home dir contents on the remote system. I have found this handy on several occasions when I needed a quick and dirty backup of some files on a remote host. Backups to the remote hosts local disk aren&#8217;t much good if the system goes down! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>So you need to backup a remote unix system but don&#8217;t have enough free disk space to tar locally and then tranfer? Try this! ssh username@hostname.tld &#8220;tar -zcvf &#8211; \/ &#8211;exclude \/proc &#8211;exclude \/dev &#8221; | cat > my-system-backup.tgz This is a breakdown of what this does: &#8211; Starts an ssh session with your remote &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.sysop.ca\/?p=50\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Quick and dirty remote unix backups&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[7],"tags":[],"class_list":["post-50","post","type-post","status-publish","format-standard","hentry","category-unix"],"_links":{"self":[{"href":"http:\/\/www.sysop.ca\/index.php?rest_route=\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.sysop.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sysop.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sysop.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sysop.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=50"}],"version-history":[{"count":1,"href":"http:\/\/www.sysop.ca\/index.php?rest_route=\/wp\/v2\/posts\/50\/revisions"}],"predecessor-version":[{"id":461,"href":"http:\/\/www.sysop.ca\/index.php?rest_route=\/wp\/v2\/posts\/50\/revisions\/461"}],"wp:attachment":[{"href":"http:\/\/www.sysop.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sysop.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sysop.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}