{"id":18665,"date":"2015-12-04T05:01:14","date_gmt":"2015-12-03T19:01:14","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=18665"},"modified":"2016-01-30T09:42:10","modified_gmt":"2016-01-29T23:42:10","slug":"linux-remote-backup-via-rsync-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/linux-remote-backup-via-rsync-tutorial\/","title":{"rendered":"Linux Remote Backup via rsync Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/rsync_remote.jpg\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"Linux Remote Backup via rsync Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/rsync_remote.jpg\" title=\"Linux Remote Backup via rsync Tutorial\" id=\"ilrb\" onmouseover=\" this.src=this.src.replace('.jpg','.xgif').replace('.gif','.xjpg').replace('.x','.');   \"  \/><\/a><p class=\"wp-caption-text\">Linux Remote Backup via rsync Tutorial<\/p><\/div>\n<p>A couple of days ago, with <a target=_blank title='Linux Backup via rsync Primer Tutorial' href='#lbvrpt'>Linux Backup via rsync Primer Tutorial<\/a> as shown below, we used the Linux command &#8220;rsync&#8221; backup a local disk to a removable disk on a MacBook Pro laptop using a USB connected Seagate Backup Plus Portable Drive.<\/p>\n<p>Today we use that same USB connected Seagate Backup Plus Portable Drive and the same MacBook Pro laptop, but backup a directory (or folder) on a remote web server &#8230; the www.rjmprogramming.com.au Linux CentOS web server, to be precise.<\/p>\n<p>The technique used, and great information for this, again, came from Linux.com&#8217;s <a target=_blank title='Useful link' href='https:\/\/www.linux.com\/learn\/tutorials\/836851-how-to-backup-files-in-linux-with-the-command-line'>useful link<\/a>, so thanks for that.  These techniques involve the use of ssh (<a target=_blank title='Secire shell information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Secure_Shell'>Secure Shell<\/a>) which we have talked about at this blog with <a target=_blank title='Web Server Access Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/web-server-access-primer-tutorial\/'>Web Server Access Primer Tutorial<\/a>.  We use ssh a lot to login (the way you might do with <a target=_blank title='Telnet information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Telnet'>telnet<\/a>) to our www.rjmprogramming.com.au web server, and here it is helping out &#8220;rsync&#8221; in an &#8220;sftp&#8221; feeling way.<\/p>\n<p>To backup remotely, if not too much of a load for the live web server, offers great possibilities for piece of mind for the webmasters involved, as you can imagine.<\/p>\n<p>Lately, options related to backup to the &#8220;cloud&#8221; are becoming more common, and this is an option too, though tend to think it is better to only involve local resources as the backup media.<\/p>\n<p>We think the advantages of using a Linux method of backing up on a Macbook Pro laptop include &#8230;<\/p>\n<ul>\n<li>Linux processes are not in your face &#8230; while you get on with other things in the usual GUI environment<\/li>\n<li>able to be run at a time of your choosing (via shell scripting with crontab, or at login via a .profile arrangement, perhaps), even interactively &#8230; though Time Machine can do some of this too<\/li>\n<li>the backup can run in the background &#8230; though Time Machine can do this too<\/li>\n<li>the backup process could easily leave you a log<\/li>\n<li>Linux backups are capable of handling remote backup tasks and scenarios<\/li>\n<\/ul>\n<p> &#8230; so today&#8217;s discussion helps with that last idea in the list above in two parts &#8230;<\/p>\n<ol>\n<li>the original remote backup <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/rsync_remote.jpg\" title='click first picture'>example<\/a><\/li>\n<li>ongoing incremental remote backup <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/rsync_remote.gif\" title='click second picture'>example<\/a><\/li>\n<\/ol>\n<hr>\n<p id='lbvrpt'>Previous relevant <a target=_blank title='Linux Backup via rsync Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/linux-backup-via-rsync-primer-tutorial\/'>Linux Backup via rsync Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"Linux Backup via rsync Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/rsync-293of.jpg\" title=\"Linux Backup via rsync Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Linux Backup via rsync Primer Tutorial<\/p><\/div>\n<p>On a Macbook Pro laptop you can use the Mac OS X Time Machine approach to backing up your data, as we talked about with <a target=_blank title='Mac Backup Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/mac-backup-tutorial\/'>Mac Backup Tutorial<\/a>.  However, a Mac OS X laptop has access to an underlying Linux operating system, that has had great software, including backup software, written for it over many years.<\/p>\n<p>What would be the advantages of using a Linux method of backing up on a Macbook Pro laptop?  Can think of &#8230;<\/p>\n<ul>\n<li>Linux processes are not in your face &#8230; while you get on with other things in the usual GUI environment<\/li>\n<li>able to be run at a time of your choosing (via shell scripting with crontab, or at login via a .profile arrangement, perhaps), even interactively &#8230; though Time Machine can do some of this too<\/li>\n<li>the backup can run in the background &#8230; though Time Machine can do this too<\/li>\n<li>the backup process could easily leave you a log<\/li>\n<li>Linux backups are capable of handling remote backup tasks and scenarios<\/li>\n<\/ul>\n<p>Today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/\" title='Click picture'>slideshow<\/a> presentation starts off with a photo of our &#8230;<\/p>\n<ol>\n<li> &#8230; Seagate Backup Plus Portable Drive <a style=\"background-color: green;\" onclick=\"this.style.backgroundColor='green'; document.getElementById('li1').style.display='inline'; \" onmouseover=\"this.style.backgroundColor='green'; document.getElementById('li1').style.display='inline'; \" href=\"#\">\u2139<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/rsync-276of.jpg\" style=\"display: none;\" id=\"li1\"><\/a> hooked up to our Macbook Pro via a black USB lead plugged into one of the Macbook Pro USB ports<\/li>\n<li>we start up the Macbook Pro application called Terminal in the Utilities folder of the Applications folder<\/li>\n<li>the Linux command\n<p><code> df -k <\/code><\/p>\n<p> will show you the disks and removables (of which our Seagate Backup Plus is one), the latter of which normally get a name starting with &#8220;\/Volumes\/&#8221; as for our &#8220;\/Volumes\/Laura&#8221;<\/li>\n<li>we are going, today, to backup the local MAMP server to the Seagate Backup Plus via\n<p><code> rsync -r \/Applications\/MAMP \/Volumes\/Laura\/ <\/code><\/p>\n<p> as you can see with <a style=\"background-color: green;\" onclick=\"this.style.backgroundColor='green'; document.getElementById('li4').style.display='inline'; \" onmouseover=\"this.style.backgroundColor='green'; document.getElementById('li4').style.display='inline'; \" href=\"#\">\u2139<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/rsync-279of.jpg\" style=\"display: none;\" id=\"li4\"><\/a> (and on)<\/li>\n<li>now to indicate some success with this to you, we turn the Firefox web browser to Open File one of the backup HTML files (because it is a step too far to think you will be able to run PHP from the backup disk &#8230; perhaps tomorrow) &#8230; maybe you remember india_map.html from the series of blog postings ending with <a target=_blank title='PHP Geographical Image Map Yet More Google Charts Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/php-geographical-image-map-yet-more-google-charts-tutorial\/'>PHP Geographical Image Map Yet More Google Charts Tutorial<\/a> ? &#8230; you can see with <a style=\"background-color: green;\" onclick=\"this.style.backgroundColor='green'; document.getElementById('li5').style.display='inline'; \" onmouseover=\"this.style.backgroundColor='green'; document.getElementById('li5').style.display='inline'; \" href=\"#\">\u2139<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/rsync-285of.jpg\" style=\"display: none;\" id=\"li5\"><\/a><\/li>\n<li>okay, that works, and so now, what about if india_map.html changes back at the Macbook Pro hard disk&#8217;s MAMP&#8217;s htdocs folder &#8230; we make a change to the &lt;h1&gt;India&lt;\/h1&gt; heading to &lt;h1&gt;India Map&lt;\/h1&gt;\n<li>so now we are going to incrementally backup the local MAMP server to the Seagate Backup Plus via\n<p><code> rsync -ruv \/Applications\/MAMP\/ \/Volumes\/Laura\/MAMP\/ <\/code><\/p>\n<p> as you can see with <a style=\"background-color: green;\" onclick=\"this.style.backgroundColor='green'; document.getElementById('li7').style.display='inline'; \" onmouseover=\"this.style.backgroundColor='green'; document.getElementById('li8').style.display='inline'; \" href=\"#\">\u2139<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/rsync-293of.jpg\" style=\"display: inline;\" id=\"li7\"><\/a><\/li>\n<li>now to indicate some success with this to you, we turn the Firefox web browser to Open File that same india_map.html HTML file &#8230; as you can see with <a style=\"background-color: green;\" onclick=\"this.style.backgroundColor='green'; document.getElementById('li8').style.display='inline'; \" onmouseover=\"this.style.backgroundColor='green'; document.getElementById('li8').style.display='inline'; \" href=\"#\">\u2139<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/rsync-294of.jpg\" style=\"display: none;\" id=\"li8\"><\/a><\/li>\n<\/ol>\n<p>Of course, as with all Linux a <\/p>\n<p><code> man rsync <\/code><\/p>\n<p> command <a style=\"background-color: green;\" onclick=\"this.style.backgroundColor='green'; document.getElementById('li0').style.display='inline'; \" onmouseover=\"this.style.backgroundColor='green'; document.getElementById('li0').style.display='inline'; \" href=\"#\">\u2139<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/rsync-288of.jpg\" style=\"display: none;\" id=\"li0\"><\/a><a style=\"background-color: green;\" onclick=\"this.style.backgroundColor='green'; document.getElementById('li00').style.display='inline'; \" onmouseover=\"this.style.backgroundColor='green'; document.getElementById('li00').style.display='inline'; \" href=\"#\">\u2139<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Backup\/rsync\/rsync-289of.jpg\" style=\"display: none;\" id=\"li00\"><\/a> helps explain things further, and we hope this tutorial and Linux.com&#8217;s <a target=_blank title='Useful link' href='https:\/\/www.linux.com\/learn\/tutorials\/836851-how-to-backup-files-in-linux-with-the-command-line'>useful link<\/a> is of some help for you too.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d18611' onclick='var dv=document.getElementById(\"d18611\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/backup\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d18611' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d18665' onclick='var dv=document.getElementById(\"d18665\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/ssh\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d18665' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>A couple of days ago, with Linux Backup via rsync Primer Tutorial as shown below, we used the Linux command &#8220;rsync&#8221; backup a local disk to a removable disk on a MacBook Pro laptop using a USB connected Seagate Backup &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/linux-remote-backup-via-rsync-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,25,29,37],"tags":[128,337,707,723,725,1746,1791,1129,1190,1252,1319],"class_list":["post-18665","post","type-post","status-publish","format-standard","hentry","category-elearning","category-networking","category-operating-system","category-tutorials","tag-backup","tag-disk","tag-linux","tag-mac","tag-mac-os-x","tag-rsync","tag-seagate","tag-sftp","tag-ssh","tag-terminal","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/18665"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=18665"}],"version-history":[{"count":3,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/18665\/revisions"}],"predecessor-version":[{"id":18676,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/18665\/revisions\/18676"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=18665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=18665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=18665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}