A couple of days ago, with Linux Backup via rsync Primer Tutorial as shown below, we used the Linux command “rsync” backup a local disk to a removable disk on a MacBook Pro laptop using a USB connected Seagate Backup Plus Portable Drive.
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 … the www.rjmprogramming.com.au Linux CentOS web server, to be precise.
The technique used, and great information for this, again, came from Linux.com’s useful link, so thanks for that. These techniques involve the use of ssh (Secure Shell) which we have talked about at this blog with Web Server Access Primer Tutorial. We use ssh a lot to login (the way you might do with telnet) to our www.rjmprogramming.com.au web server, and here it is helping out “rsync” in an “sftp” feeling way.
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.
Lately, options related to backup to the “cloud” 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.
We think the advantages of using a Linux method of backing up on a Macbook Pro laptop include …
- Linux processes are not in your face … while you get on with other things in the usual GUI environment
- 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 … though Time Machine can do some of this too
- the backup can run in the background … though Time Machine can do this too
- the backup process could easily leave you a log
- Linux backups are capable of handling remote backup tasks and scenarios
… so today’s discussion helps with that last idea in the list above in two parts …
Previous relevant Linux Backup via rsync Primer Tutorial is shown below.
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 Mac Backup Tutorial. 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.
What would be the advantages of using a Linux method of backing up on a Macbook Pro laptop? Can think of …
- Linux processes are not in your face … while you get on with other things in the usual GUI environment
- 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 … though Time Machine can do some of this too
- the backup can run in the background … though Time Machine can do this too
- the backup process could easily leave you a log
- Linux backups are capable of handling remote backup tasks and scenarios
Today’s slideshow presentation starts off with a photo of our …
- … Seagate Backup Plus Portable Drive ℹ hooked up to our Macbook Pro via a black USB lead plugged into one of the Macbook Pro USB ports
- we start up the Macbook Pro application called Terminal in the Utilities folder of the Applications folder
- the Linux command
df -k
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 “/Volumes/” as for our “/Volumes/Laura”
- we are going, today, to backup the local MAMP server to the Seagate Backup Plus via
rsync -r /Applications/MAMP /Volumes/Laura/
as you can see with ℹ (and on)
- 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 … perhaps tomorrow) … maybe you remember india_map.html from the series of blog postings ending with PHP Geographical Image Map Yet More Google Charts Tutorial ? … you can see with ℹ
- okay, that works, and so now, what about if india_map.html changes back at the Macbook Pro hard disk’s MAMP’s htdocs folder … we make a change to the <h1>India</h1> heading to <h1>India Map</h1>
- so now we are going to incrementally backup the local MAMP server to the Seagate Backup Plus via
rsync -ruv /Applications/MAMP/ /Volumes/Laura/MAMP/
as you can see with ℹ
- 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 … as you can see with ℹ
Of course, as with all Linux a
man rsync
command ℹℹ helps explain things further, and we hope this tutorial and Linux.com’s useful link is of some help for you too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
21 Responses to Linux Remote Backup via rsync Tutorial