# # $Id: crontab.txt,v 1.2 2013/12/10 14:09:18 jes91 Exp $ # # Adjust to suit: # remove 'expr $(hostname) ... {' and the trailing ';}' if you want the # backup to be attempted always, i.e., even when not connected # to the Cambridge network; # use only ~/tardis/laptop_data_backup.sh within the braces {...} if you # don't mind receiving mail every day irrespective of whether # the backup failed or succeeded (assuming that cron will send # you mail if the job produces any output - see below). # # For Mac OS X later than 10.7 (Lion) note that: # cron throws away the output of cron jobs regardless of any MAILTO # variable defined; # although the mail command exists, local mail delivery is completely # broken by default and the mail will disappear without trace. # Given these limitations (perhaps not insuperable but not worth the effort # to fix since it will all be broken afresh with the next OS X release) it is # best to just use ~/tardis/laptop_data_backup.sh within the braces {...} and # then install Cyberduck SFTP client or similar to keep an eye on the # completion, or otherwise, of your backups. # 30 14 * * 1-5 expr $(hostname) : '.*\.cam\.ac\.uk$' >/dev/null && { ~/tardis/laptop_data_backup.sh > /tmp/tardis.$$ 2>&1 && mail -s 'Backup succeeded' $LOGNAME