Home Page
 License
 Download
 Syntax
 Notes

Crontooie 1.0

A Crontab GUI for Mac OS X


Basic crontab syntax

Controoie makes no effort to validate your crontab entries before putting them in play, so remember the "sorcerer's apprentice" and be very careful what you ask for!

cron loads the crontab file(s) at startup, and whenever it detects a change. At the start of every minute of the day it checks the schedule for jobs that need to run because their schedule string matches the current minute. If if finds one, it initiates the job. If it happens that cron is not running (user logged out, machine asleep, etc.) at a time when a script should be run, the job will not be launched. Further, cron does not 'catch up' missed jobs, so it the machine wakes up 30 seconds later, it doesn't matter.

Scheduling rules set simple "matching" requirements, broken down into a series of time domains (minutes, hours, days, months, etc.). The rules for each time domain consist of one or more characters in special syntactic groupings, described this way:

*the wildcard character. Matches every case.
n one specific minute/hour/etc.
n,m a comma-delimited list of matching minutes/hours/etc.
n-m an inclusive range of minutes/hours/etc.
/n "every n intervals" (used to modify a range--see below.
sun,mon day names, used in "weekday" column.

The fields occur in sequence: minutes, hours, days-of-the-month, month-numbers, weekdays-by-name, and command-to-execute. Given this, you should be able to make sense of most crontab entries (I've managed, though I'm no expert). For example:

    12 0-6 * 7 * /path/cronjob

will run the command "/path/cronjob" at 12 minutes past the hour between 0 (midnight) and 6 (6am), but only during the month of July!

    12 23-7/2 * * sat,sun /path/cronjob

will run the command "/path/cronjob" at 12 minutes past every other hour (because of the "/2") between 23 (11pm) and 7 (7am), on every Saturday or Sunday.