10.4: Sync iTunes via rsync, python, and Automator
Mar 02, '07 07:30:02AM
Contributed by: berndtj
OK, this is my first hint, but I figured I should share.
This is by no means an elegant solution, but it works for me. I'm using a combination of rsync, python, and Automator to sync my iTunes libraries between machines. Here's how...
- Get the files from one computer to the other. I use rsync for this. Additionally, you will need to have Personal File Sharing enabled on the destination computer:
rsync -avzu /local/music/folder
username@destination_computer.local:/dest/music/folder
Add an n to the options the first time you try, as it will just do a dry run and you can see if it's going to work. Now you have all the files on the destination computer, but iTunes still doesn't know anything about them.
- The following is to be done on the destination computer. Download my syncTunes.py python script (original host | macosxhints mirror). We will actually be using Automator to call this script. The script compares all of the actual music files in the directory tree with the files that are in the iTunes library (make sure you quit iTunes first). It then prints out a list of all of the mismatched files (there will be more than you think, but don't worry about it).
- Download the librarySync automator workflow (original host | macosxhints mirror). You will have to modify the arguments in the first block of the workflow for your particular folder arrangement. Once the paths are set, run the workflow.
In the future, it is only necessary to do steps one and three. It's not beautiful, but it gets the job done for me.
[robg adds: I haven't tested this one.]
Comments (10)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20070225092702347