LOCK_FILE="/tmp/rsync_backup.lock"
LOG_FILE="/tmp/rsync_backup.log"
RSYNC="/usr/local/bin/rsync"

if [ -e $LOCK_FILE ]; then
	TIMESTAMP=$(date)
	echo "$TIMESTAMP: lock file exists, exit now" >> $LOG_FILE
	exit
fi

cat /dev/null > $LOG_FILE

touch $LOCK_FILE


# you need to edit these two lines...

$RSYNC --iconv=UTF8-MAC,UTF-8 -e ssh -az --delete-after user@remotehost:/some/path/ ~/Documents/path/

$RSYNC -e ssh -az --delete-after -X --exclude 'Movies' ~ user@remotehost:/path/mybackup/



rm $LOCK_FILE
