Thursday, June 14, 2012

Practical iTunes backup with Rsync

If you are a mac user with a large iTunes collection, backups can be a chore. Some people use Time Machine, carbon-cloner/super-duper, or the traditional method of simple drag-n-drop. Well, I suggest you embrace the built-in *NIX way of doing things and just use rsync. 

It is natively built in the operating system and many of the cloner type apps are just pretty GUI skins on top of Rsync. Time machine is notorious at making duplicates when you don't need to. Who needs to revert back 4-5 revisions of the same file?

Since I started iTunes Match (review coming), I've been updating my music collection and re-tagging my mp3s quite a bit. For example, I would update artist and genre one week. Another week, I would swap out my album art for higher resolution ones that will look nice on the retina iPad. Time Machine will store the 3 different iterations in my example.

Also, rsync is more intuitive than simply drag-n-dropping files. I have over 20,000 files in a music folder. I may be updating or changing 3-4 files at any given time. I may not know the location of the files but I've made updates within iTunes. Instead of looking for the files or copying the entire folder, rsync will simply match up what needs to be synchronized. This is a real time saver.

I won't go into the details of Rsync. You can google and read the man page.  Here is a very simple usage example with options explained:

 rsync -auvp --progress /Users/username/Music/ /Volumes/MUSIC_BK/Music/  
 -a archive  
 -u update only (don't update newer files)  
 -v verbose  
 -p preserve permissions  
 --progress = show progress  

Here, I am simply copying updates from my Music folder to a USB drive. In fact, you can simply write a shell script and leave it on the USB/Firewire drive. When I need to synch, I simply drag the script over to a Terminal window to start my rsync session.

Rsync is also good in multi-platform environments and cloud. I always rsync files to my DropBox or my PogoPlug. When I have a bunch of shell scripts or excel files, I use rsync to synchronize files between OSX and Linux.

No comments:

Post a Comment