ip

One way, automated iPhoto library sync

Update: whilst photo sharing between family members still sucks, iCloud Photo Library solves most of these issues. 

As per a previous post Multiple iTunes library on one Mac, I feel that Apple still neeeds to do a lot to address multiple Macs all sharing wanting access to the same library of media. Managing multiple libraries/systems sucks. I’ve tried manually managed folder structues, then using tools such as Google Picasa, but it’s just too much work.

So in our household, the master iPhoto library is on my MacBook, and it syncs in one direction to my wife’s Mac. She can’t add/edit/remove photos, but she gets access to them all, which is all she needs.

Here’s the AppleScript that i’m using to do it:

#!/bin/bash

# NOTE: “Remote Apple Events” must be enabled on the remote Mac for the user specified below

# local parameters
localLibraryPath=/Users/LocalUser/Pictures/iPhoto\ Library.photolibrary # (NO QUOTES)

# remote parameters
remoteUser=”RemoteUser”
remotePassword=”password”
remoteHost=”RemoteMac.local”
remoteShareName=”RemoteShareName”
remoteLibraryPath=/Volumes/RemoteShareName/Photos/iPhoto\ Library.photolibrary # (NO QUOTES)

# generate remote server path string
remoteServerPath=$remoteUser”:”$remotePassword”@”$remoteHost

# quit iPhoto on local machine
echo “Quiting iPhoto on local…”
osascript -e “tell application \”iPhoto\” to quit”

# quit iPhoto on remote machine
echo “Quiting iPhoto on remote…”
osascript -e “tell application \”iPhoto\” of machine \”eppc://$remoteServerPath\” to quit”

# mount remote volume
echo “Mounting remote volume…”
bashMountRemote=$(osascript -e “mount volume \”afp://$remoteServerPath/$remoteShareName\””)

# wait for iPhoto to close and tidy up
echo “Sleep for a 30 sec, wanna make sure iPhoto is nice and relaxed…”
sleep 30

# do the sync
echo “Start the sync…”
rsync –recursive –archive –compress –links –times –delete –verbose –exclude ‘Apple TV Photo Cache’ –exclude ‘iPod Photo Cache’ “$localLibraryPath/” “$remoteLibraryPath/”

# done
echo “Sync completed”

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>