#!/bin/bash
# Check to make sure our log file exists.  If not, create it.
if [ ! -e /var/log/backup ]; then
   touch /var/log/backup
fi
# Write in log that this script was executed and when
DATE=`date`
echo "Backup Cron Job Executed "$DATE >> /var/log/backup
# Check if the media exists.  If it does, rsync.
if [ -d /media/LACIE2 ]; then
   rsync -qavz --delete-after /home/* /media/LACIE2/ >> /var/log/backup \
      || echo "There was a problem with the command" >> /var/log/backup
else
   echo "The backup media was not present and/or not mounted" \
      >> /var/log/backup
fi

