LOCK_FILE="/tmp/rsync_backup.lock"
LOG_FILE="/tmp/rsync_backup.log"

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 -e ssh -az --delete-after user@remotehost:/some/path/ ~/Documents/path/

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



rm $LOCK_FILE
