Before you dive into this article you need to know that you will be using the terminal. The terminal can look really scary but trust me it’s not all that bad.
Rsync is a command line utility that can sync your data to other places on your hard drive, from hard drive to hard drive or from computer to computer! I personally use Rsync to make daily backups of my websites, to make a backup of all my music and to move my MySQL databases from one server to another. Rsync is included with every install of OS X and is available for Unix and Linux.
Let’s make up a story to use as an example! Joe Brown has a PowerMac G5. He stores all of his music in the Music folder in his home folder. It looks something like this – /Users/joebrown/Music/. That’s the path to his music. Joe Brown is an intelligent user and knows that he should backup whatever data is important to him. Joe Brown goes to Small Dog Electronics and picks up an external hard drive. He gets home and plugs it into his computer. Joe Brown renames his new hard drive to ‘Audio’. The path to the new hard drive is /Volumes/Audio/ (you’ll also find Macintosh HD in /Volumes/. All the hard drives and flash keys, and other storage devices are kept in /Volumes/). Joe Brown wants to sync all the music from /Users/joebrown/Music/ onto his new hard drive.
The command Joe Brown uses in his terminal window is:
rsync -avz /Users/joebrown/Music/ /Volumes/Audio/
This command will synchronize files from Joe’s internal hard drive (specifically his music) to his new external hard drive called ‘Audio’.
This is a simple, basic way to use rsync. This example should help you sync from one place on your hard drive to another or an external hard drive.
A similar command:
rsync -avz /Users/joebrown/Music/ /Users/joebrown/Desktop/
will sync your music to your desktop. Although that doesn’t seem practical it’s completely doable!
Rsync can be automated with other command line utilities. For example I set my rsyncs to run in the early morning hours so they don’t disturb my users. You may set your rsync to run in the morning hours too or the late evening, whenever it’s convenient for you. The utility that allows you to schedule this is called a cron. You can have 1 or 2 or 100 crons. Each cron has a command that it will run at a specific time. Crons are a whole other blog post, but here’s a couple links about rsync and crons!
Readers are more then welcome to email me if they need help!