CRON syntax

Chances are, you have used CRON syntax in the past. If you’re anything like me, you probably used AI to generate the CRON expression that matched your needs.

Sometimes however, I like using my own brain for a change. In that spirit, I did a little refresher on the (traditional Unix) CRON syntax. I’d like to share it with you.

*****
MinuteHourDay (month)MonthDay (week)
    0=7=Sunday

* = any value

, = value list separator. E.g. 1,5 = the values 1 and 5.

– = range of values. E.g. 2-6 = the values 2, 3, 4, 5 and 6.

/ = step values. E.g. */30 * * * * = every 30 minutes.

Example:

*/308-20**1-4
Every 30 minutesFrom 8:00 till 20:30Every day of the monthEvery monthMonday till thursday