Using rsync to synchronize iTunes libraries

As I was on my nth drag-and-drop transfer of my music collection on my work computer on to my external to bring home and listen to nights, it occurred to me that there may be a better solution. I had been deleting the music from my external and then transferring my entire collection to my external from my work computer: hello inefficiency. It dawned upon me to ask the developers about potential solutions, and thanks to help from Will and Jeff, I am now using rsync to keep my two collections synchronized.

rsync allows you to synchronize files from one directory to another. There are endless options, whether you want old files to be deleted, new files to be added, etc. The solution I found most effective for keeping my iTunes collection was run the following command:

rsync -av --delete ~/Music/iTunes/ /Volumes/External Drive/iTunes/

The first directory is the source directory, or where the music is coming from. The latter directory is the destination, or host, directory. The '-av' stands for two commands, 'a' and 'v'. The letter 'a' represents 'archive', which makes sure that all of the permissions in the new host directory (the latter of the two) recursively. 'v' stands for verbose, which outputs any action that is occurring so that I can keep tabs on the progress and check for errors. Adding the --delete ensures that any files I have deleted in the source directory will also be deleted in the host directory. Now to check to make sure that everything will transfer cleanly you can add '--dry-run' after '--delete'. I ran this first to check that everything will work correctly without actually moving any files.

Also, by synchronizing my entire iTunes folder I am able to synchronize the playlists, artwork, and iTunes preferences. When I run this music collection on another computer, I hold down the alt button while I start iTunes, and choose that iTunes folder. This will open up that library, not the library that it typically defaults to.

The first time this command runs it will copy everything over. Anytime it runs after that it performs the synchronization. Cheers —

Comments

Wednesday, Apr 2, 2008 / 8:20pm Errol Sayre said…

I generally recommend syncOtunes because it actually manipulates the iTunes library files to merge disparate iTunes libraries that may have different ratings or whatnot...

http://homepage.mac.com/oligrob/syncOtunes/syncOtunes.html

Obviously rsync is a great option if you are willing to maintain a single master library but syncOtunes is the way to go if you want to try to keep ratings and other library settings to be the same across all your libraries.

Thursday, Apr 3, 2008 / 9:12am Peter said…

If you're using the Mac version of rsync, you should consider adding the -E switch to preserve Mac OS-specific file attributes.

Friday, Apr 4, 2008 / 10:17am Craig Ruksznis said…

@Peter, good point, I will do that! @Errol - This is a good idea if you want to customize your sync in terms of iTunes playlists! Since I am interested in an exactly replica from one library to another, I prefer using rsync.

Saturday, Sep 13, 2008 / 9:36am Lou Nielsen said…

I have tried to use the rsync command to merge two large iTunes libraries as you outline and get the following:

rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-35.2/rsync/main.c(992) [sender=2.6.9] Somerset-2:~ lou$ rsync -av -E --delete --dry-run /Users/Sarah/Music/iTunes/ /Volumes/iTunes Music/iTunes2/ building file list ... rsync: link_stat "/Volumes/iTunes" failed: No such file or directory (2) done created directory Music/iTunes2 ./

I am relatively inexperienced and cannot figure out what is wrong . Can you please direct me?

Comments have been turned off on this blog.
Read something more recent.

Statements and opinions expressed in this blog and any comments made are the private opinions of the respective poster, and, as such, iMarc LLC is neither responsible nor liable for such content.

Meet The Author

(Craig)

Craig Ruksznis

iMarc Alumni

Search

Recent Blog Posts

Recent Comments

  • I LOLed

    Bill Keeshen commented: Nils, Love the site, congrats! You have a spirited culture as well! Regards, Bill

  • Changing Tradition (for the better)

    Nick commented: This is a fantastic and charitable idea! I would agree, purchasing from and donating to 2 local businesses is a win! Great job iMarc!

  • Content, Content, Content

    dano commented: Totally agree, once I start updating content on a regular basis I start seeing direct and repeat traffic increase exponentially! dano

  • I LOLed

    Pat McNally commented: Hi Nils, I have to be in NY this year for your 12/8 party (great invite), but wish I could be with you. I gave the invite to my 28 year old daughter, Jen Breaker, and urged her to stop in to say hi for me. I hope you and your family have a wonderful and exciting Christmas and holidays. Do you remember what I was doing on New…

  • I LOLed

    Patrick McPhail commented: I was going to go but Nick forgot to leave the keys to the developer shackles.

We heart Visitors

  • iMarc
  • 14 Inn Street
  • Newburyport, MA 01950
  • Phone: (978) 462-8848
  • Fax: (978) 462-8807
  • Directions

Contact Us

Whether you have a huge project or just want to talk about updating your site, we’re here to help. Fill out the form, and we’ll get right back to you.

Contact Us
  • All Fields Required

Close