Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As you can tell this is no where near work related. I have an iMac G5 where my itunes is currently hosted, I have also just got a new MacBook Pro. What I want to be able to do is sync my itunes library from my iMac to my MacBook Pro, that way it can be accessible away from my home network, then if I make any changes to the itunes library (like change a track name) it will sync these changes back once I connect back to the home network.

My current itunes contains music, videos, podcasts, playlists and iPhone apps, I would also like iTunes to track play counts collectively between the iMac and the MacBook Pro.

share|improve this question

migrated from serverfault.com Jun 9 '10 at 10:59

This question came from our site for professional system and network administrators.

add comment

4 Answers

This is pretty tricky, as there are several files containing iTunes metadata in addition to live running instances of iTunes. The trickiest of these to overcome is the fact that the running instance of iTunes does not write out data until it quits, so if you have running instances on both your iMac and MBP and you update the files underneath them, they will get lost. Further, paths are contained within the files, so this will not work unless you have identical paths on both machines (assuming you have not changed the defaults and have the same username, this would put the music in /Users/username/Music/iTunes/iTunes Music/ and the metadata in /Users/username/Music/iTunes/{iTunes Library,iTunes Music Library.xml}).

You can keep the music folder up to date on both by using rsync, but this only works cleanly if you either always add or delete items on one of the machines or if you only add items. If so, the two lines on the MBP would work:

% rsync -a /Users/<username>/Music/iTunes/iTunes\ Music <G5hostname>:/Users/<username>/Music/iTunes
% rsync -a <G5hostname>:/Users/<username>/Music/iTunes/iTunes\ Music /Users/<username>/Music/iTunes

You'll probably want to set up automatic authentication using public keys auth in SSH and put this in a cronjob.

To accomplish moving the metadata, I suggest you have a script running on both machines under cron which first determines if iTunces is running on the local machine and if it is not, it rsyncs the metadata files from the other server if the content on the other server is newer than that locally. Something like:

if [ `ps -ax | grep -v grep | grep -c iTunes` -ne 0 ] ; do
   rsync -au <otherhostname>:/Users/<username>/Music/iTunes/{iTunes\ Library,iTunes Music\ Library.xml} /Users/<username>/Music/iTunes
done

This still assumes that you don't make mods both instances with both instances being up continuously. Also, I have not tested this out, so there are probably some syntax errors or subtleties I'm missing.

share|improve this answer
    
This is how I keep both my iTunes and iPhoto libraries synced between 3 Macs. It seems to be pretty dang bulletproof. You'll probably want to use ‘-e ssh’ so that you don't have to have a rsync daemon running separately. –  Scott Pack Jul 1 '09 at 1:15
add comment

I used SuperSync and it did what I wanted from it, but I used it only with music and I couldn't care less for play counts, so I don't know if it does this.

share|improve this answer
add comment

I am using a tool called ChronoSync to do this right now, I just have my entire music folder (which also incudes the iTunes library metadata) synccing between the two computers. Works great for iPhoto as well.

share|improve this answer
add comment

MyTunesSync should work and has a 15 day free trial.

share|improve this answer
    
Note: it looks like MyTunesSync is now defunct. –  tapped-out Sep 26 '13 at 22:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.