check mail backup cron job

i have just installed a cron job to run at 3 in the morning once a week. It's difficult for me to test if it works because the email backup program takes the email service down before running the backup. I wondered if i could ask you gurus if this would work?

0       3       *       *       0       if cd /Volumes/Files_Backup_1;then /usr/sbin/mailbfr -b /Volumes/Files_Backup_1/mail/bak --mode rotate; fi

It's just meant to check that the backup disk is reachable before running mailbfr. This part of the script works

/usr/sbin/mailbfr -b /Volumes/Files_Backup_1/mail/bak --mode rotate

I just wanted to check that the if then fi stuff would work from a cron job?

Syntax looks ok, but the following syntax would be more robust if the directory might not be there:

0 3 * * 0 [ -d /Volumes/Files_Backup_1 ] && cd /Volumes/Files_Backup_1 &&  /usr/sbin/mailbfr -b /Volumes/Files_Backup_1/mail/bak --mode rotate

Personally I'd put the whole lot in a script and run the script from cron.

1 Like