I have my iTunes library sync’ed among my three computers using rsync.

- PC with my initial music collection (Win7)
- Synology DiskStation DS210 (tiny Linux-based server)
- Macbook (Mac OSX)

On windows, I installed cwrsync. Then I modified the provided .cmd batch file to push to the DiskStation:

rsync -avz --progress --no-g --chmod=ugo=rwX --delete --exclude='.*' --exclude '@eaDir' "/cygdrive/c/Users/Adam Klein/Music/iTunes/iTunes Music/" root@DiskStation:/volume1/Shared/music/Adam

On OSX, I pull the music:

#!/bin/bash
# rsyncs remote music library to local copy

cd ~/Music/iTunes/iTunes Music/Music
rsync --iconv=UTF8-MAC,UTF8 -Xavzh --progress --delete --exclude '@eaDir' root@DiskStation:/volume1/Shared/music/Adam/ .

Initially this behaved strangely - unicode characters with accents messed up the sync. It took some googling, but I finally stumbled on the answer. Mac does something weird with UTF8. You need an “iconv” parameter in there (note it in the command above).

You can do this without having to manually enter passwords, if you get your .ssh keys set up correctly.  You create a public/private keypair using ssh-keygen, keeping the private key in your local ~/.ssh/, and appending the public key to the remote ~/.ssh/authorized_keys file.  A post on how to do it is here.

I’ll just add you can probably rsync as a regular, non-root user. But you just have to make sure all the permissions & ownership update correctly.  Things can get a bit screwy between Win7, Linux, and OSX.

I’m moving over to an iMac soon. I wonder whether I’ll give up all this manual syncing for iCloud?

  • Bob Jonst

    Can you recommend a decent solution to control iTunes in the windows environment using Python? I used to use iTLU as a software solution but that no longer works and is no longer developed. So I am left to my own devices to create a solution to keep my itunes library in sync with storage, automatically convert recorded tv shows to mp4 using ffmpeg and add to library, push out to devices etc. Ayn recommendations would be greatly appreciated.

    • AdamDKlein

      I don’t have any experience automating iTunes software itself. You might want to try a “friendlier” music library organizer, like http://www.mediamonkey.com

© 2013 Adam Klein's Blog Suffusion theme by Sayontan Sinha, modified by Adam :)