These are my notes on how to create cron jobs in Mac OS X. Linux users are already familiar with cron. Cron jobs in Windows are called Scheduled Tasks.
First, I set the default editor to be nano. I like the simplicity of nano compared to the default vim editor. It is more humane!!
Edit the .bash_profile script
$ nano ~/.bash_profile
Add the following line
Save, exit and reload the bash script
$ source ~/.bash_profile
Open the cron table
$ crontab -e
Add the following lines (for example)
MAILTO=”” */5 9-15 * * * <command>
Save and exit
That will run <command> every 5 minutes, from 9am to 3:55pm, daily. Of course you should change <command> with a real Mac OS X command that you need to run.
Watch out for mails in:
If you wish to receive emails every time the cron job executes, change the MAILTO line to: