I think I've got it.
I opened a text editor and inserted the following script:
# Runs rsync to mirror //windowsbox/share directory to this computer
# First it mounts the directory, then checks to see if it can access a file
# If yes, then it runs rsync and unmounts the directory
# Mount the shared folder //windowsbox/share
mount -t smbfs -o username=username,password=password //windowsbox/share /mnt/windows
# Test to see if a directory in /share is accessible
if [ -d "/mnt/windows/directory" ]; then
# Mirror //windowsbox/share to /home/backup if yes
rsync -urptq --delete-after /mnt/windows/ /home/backup 2>&1 > /var/log/hourly_backup.log
echo "directory is NOT accessible"
# Unmount the shared folder //windowsbox/share
Next I saved the file as /usr/bin/backup.sh
Then I created another text file containing:
* 10,12,14 * * * root /usr/bin/backup.sh
and saved it as /etc/cron.d/backup
This should run the script daily at 10am, 12pm, and 2pm
Hopefully, this should work.