Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Sync iTunes via rsync, python, and Automator' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Sync iTunes via rsync, python, and Automator
Authored by: ebroder on Mar 02, '07 10:09:09AM

I've been using Unison for a while. It's the same software that MyDreamApp's Portal is going to be based on. It syncs over SSH, resolves conflicts in both directions, and is kind of cool.

The other thing I did is that I setup multiple sync profiles so that I could sync Music, Docs, Movies, etc independently. This also meant that I could keep my docs in sync with a Windows machine, because on Windows I set the My Docs profile to ignore My Music, etc. It's also relatively easily cron-able, you just need a little extra magic to keep multiple instances from running at the same time. Here's the script I wroteup (it takes the profile name to sync as a single argument):


#!/bin/bash

PATH=/sbin:$PATH

if [ ! -f "/Users/evan/Library/Application Support/Unison/$1.prf" ]; then
	echo "Error: please specify valid profile"
	exit 1
fi
if [ -f "/tmp/sync_$1" ]; then
	exit 2
fi

IPADDRESS=`ifconfig | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | awk '{ print $2}'`
if [ "${IPADDRESS:0:3}" != "18." ]; then
	exit 3
fi

touch /tmp/sync_$1
unison -batch $1
rm /tmp/sync_$1
(The script also only syncs when I'm on my school's network)

[ Reply to This | # ]