How to mirror external hard drives on a Mac
This backup technique is pretty simple but can be intimidating for those who are not comfortable with using the terminal. At the core of Apple’s OS is Unix and one of Unix’s utilities is a free nifty program called rsync. According to the manual page on rsync, rsync can “transfer just the differences between two sets of files across the network connection.” We’re going to create a script that will automatically mirror one hard drive to another using rsync.
Creating an executable script
Instead of typing out the necessary commands each time we want to mirror our two hard drives, we’re going to create a script we can run from the terminal.
First, open up a text editor. TextEdit works but I personally use a free program called Smultron. Now paste the following into the editor:#!/bin/sh
echo This is a working script
Save this file in the home directory, the directory where Documents, Pictures, etc reside, to make it easy to find. Keep the name simple. I used rsync-backup and will use that name from here on but it can be anything.
Now, open up the Terminal. This can be found in Utilities in the Application folder. By default, the prompt starts in the current users home folder where we just saved this script. Files can’t be run until they’ve been given the execute permission. This is where the chmod command comes in. Run the following command on the newly created script:
chmod +x rsync-backup
If chmod didn’t return anything then test the following command:
./rsync-backup
This command should return “This is a working script.” We now have a executable script that we can add our rsync commands to.
The rsync command
Go back to the text editor and/or open up the script we just created. The echo line is not necessary and can be deleted. Now add the following line.
archives=/Volumes/Echo/Archives
This creates a variable called $archives with the location of where we want to copy the files to. The first part of the location, “Volumes,” will not change. All hard drives are mounted here. I recommend keeping hard drive names simple. In this case, my hard drive I’m copying my files to is called Echo and I’m copying all of the files into a folder called Archives on Echo. If a hard drive name has a space it it, an escape character must be added before the space. Do this by adding a backslash, “\” for example “Echo\ 2″
It’s time for the magic command, rsync. Add the following line to the script:
rsync -aP /Volumes/Lilac $archives
This is what does the actual work. We use two switches here. The first one, the -a, is an archive parameter. To learn more about what it does exactly please read the man page on rsync. The second, -P, displays rsync’s progress. Then comes the location of the files to mirror. In this case, I’m mirroring my hard drive called Lilac. Notice the lack of a trailing slash. The final option is the variable $archives, which we already created, and contains the location of where we want our files to go.
At this point, the script is fully functional. To test it out, go to the Terminal and type:
./rsync-backup
The script will start copying over any missing and/or changed files. If this is the first time the script has been run it will copy all of the files over. If something goes wrong or is unintentionally run press Control + C to stop the current running command.
Here’s a complete basic version of the script:
#!/bin/sh
archives=/Volumes/Echo/Archives
rsync -aP /Volumes/Lilac $achives
Keep in mind, rsync is not limited to just mirroring hard drives it can be used to back up any specific folder.
A more complex script
Using a script allows for a lot of flexibility. Here’s a more advanced script similar to what I use:
#!/bin/sh
# Where to and Such
archives=/Volumes/Echo/Archives
logs=/Volumes/Echo/Logs/log-rysnc.txt
# Make sure the log file exists
touch $logs
# Write to the logs some basic information
echo '**************************' >> $logs
echo 'rsync Started' >> $logs
echo $archives >> $logs
# Log the start time
date=`date "+%Y-%m-%d-%H:%M:%S"`
echo $date >> $logs
### Folders to Backup ###
# Photos
rsync -aP /Users/Exampler/Photography /Volumes/Lilac
echo '- Photography to Lilac Run' >> $logs
rsync -aP /Volumes/Lilac $archives
echo '- Lilac to Archives Run' >> $logs
# Log the stop time
echo 'Backup Completed' >> $logs
date +%Y-%m-%d-%H:%M:%S >> $logs
There’s a couple things to notice about this script. For one, I’ve added a log. This just records when and how long it took the script to run. Second, there’s two rsync commands here. First, the Photography folder is copied to Lilac and then Lilac is copied to Echo. This is just a sample to show what is possible.
What’s the difference between broad and phrase matching?
In short, phrase matching is an exact keyword phrase search and broad matching is an open search including variants. Most searches are broad matched so the money lies in broad matching. Phrase matched searches are important when looking for niches and discovering low competition phrases.
It’s much easier to increase phrase matched rankings. However, as a site raises in phrase matched rankings typically it’s broad match rankings also slowly increase.
In Google, to do a phrase match search just add a quote at beginning of the phrase. The trailing quote isn’t necessary. Google will then look for that exact phrase with the words in that order. For example: “isaac suttell
Broad matching, ie no quotes, searches for all of the keywords anywhere on a particular page in no particular order. So, if we were to do a search for my name, Isaac Suttell, the search could find someone else with the first name Isaac and another person with the last name Suttell on the same page but the result might have nothing to do with “Isaac Suttell.”
If a site is properly optimized for a keyword phrase, overtime it will build it’s reputation and increase it’s broad match ranking.

