#!/bin/bash
#
# iPhotoBackup.sh 1.0
#
# Script syncs a iPhoto'08 Library to another directory.
# The modified pictures will get merged with the originals.
#
# Copyright 2009 CODE2K:LABS
#
# Latest version available at:
# http://www.code2k.net/assets/files/iPhotoBackup.sh
#
# Modify variables to fit your needs:
#
SRC="/Users/andreas/Pictures/iPhoto Library"
DST="codestore:/volume1/photo"
TMP=~/tmp
EXCLUDE="$TMP/iphoto.exclude"
cd "$SRC"
find ./Modified -type f -print | sed 's!./Modified!!' > $EXCLUDE
rsync -azP --exclude-from="$EXCLUDE" --delete "$SRC/Originals/" "$DST"
rsync -azP "$SRC/Modified/" "$DST"
rm "$EXCLUDE"