Although launchd is the preferred method of scheduling jobs with Mac OSX, the good old cron job is easier to configure and still works:
1 2 |
sudo touch /etc/crontab crontab -e |
Press i to go into vim’s insert mode.
Add a shebang if you want to run the jobs with you favorite shell:
#!/bin/zsh
enter your cron job e.g.
0 0 * * * brew update && brew upgrade
where 0 0 * * * stands for minute, hour, day, month, weekday
Press esc
to exit vim’s insert mode
type ZZ ( in capital letters )
Verify by using
1 |
crontab -l |
If a cron job fails, you will get a system mail.