DataKitchen DataOps Documention

Cron Expression Basics

The DataKitchen platform uses the Kubernetes scheduler for order scheduling, so it translates standard cron syntax and time zone definitions to set the date/time for order runs.

While the scheduler follows standard cron syntax, it has some limitations handling complex cron expressions and non-UTC time zones.

Cron Fields & Characters

Cron expressions in the scheduler are strings of five fields, separated by spaces. The second and year fields, found in some cron implementations, are not supported.

  <minute> <hour> <day-of-month> <month> <day-of-week>

Where:

  • minute = 0-59
  • hour = 0-23
  • day-of-month = 1-31
  • month = 1-12 or JAN-DEC
  • day-of-week = 0-7 or SUN-SAT (Sunday can be represented by either 0 or 7)

Characters Used in Expressions

Characters Fail with Non-UTC Time Zones

At this time, the DataKitchen cron scheduler does NOT support the use of commas and dashes together when schedules are set using non-UTC time zones.

Use the UTC time zone with complex schedules, as in "2,5,15-45/2 2 1-5,7,31 MAR,DEC WED"

Character
Definition

Asterisk (*)

Means "all," as in the order should for every unit of time where the asterisk appears in the expression.


Dash (-)

Means "range," as in a range of units of time. For example, "1-4" in the day-of-week field sets the schedule for Monday through Thursday.
NOTE: commas and dashes used together are not supported with non-UTC time zones! Dashes are not supported in day-of-month or day-of-week fields if there is hour overflow


Comma (,)

Separates multiple values in a unit of time. For example, "MON, WED, FRI" in the day-of-week field sets the schedule to run on those three days.
NOTE: commas and dashes used together are not supported with non-UTC time zones! Commas are not supported in day-of-month or day-of-week fields if there is hour overflow


Forward Slash (/)

Defines the starting value and incremental or step value in a unit of time. For example, "5/15" in the minute field sets the schedule to run at the 5, 20, 35, and 50 minute marks of an hour.


Time Zones

While the scheduler supports many time zones, there are limitations with using certain cron syntax with non-UTC time zones, due to the translation that the platform must perform.

As noted above, schedules with non-UTC time zones cannot employ cron expressions using both commas and dashes.

UTC Workaround

For a workaround, users should select "UTC" as the time zone, and then write the cron expression with the appropriate hours translated already.

Complex schedules should use the UTC time zone to avoid errors or unexpected order runs.

Complex schedules should use the UTC time zone to avoid errors or unexpected order runs.

Standard Time Zone Expression
UTC Time Zone Expression

30 09 * * *
At 9:30 am every day, EST
(America/New_York, UTC-05:00)


30 14 * * *
At 14:30 every day, UTC

15,45 22 * * TUE
At 10:15 pm and 10:45 pm every Tue., EST (America/New_York, UTC-05:00)

15,45 3 * * WED
At 03:15 and 03:45 every Wed., UTC
(UTC translation shifts to the next day)

Supported Cron Expressions

See Crontab.guru for additional help in translating cron expressions.

As a reminder, the syntax follows this field order:

  <minute> <hour> <day-of-month> <month> <day-of-week>
Expression
Definition

0 15 * * *

At 3:00 pm every day


30 9 * * MON-FRI
30 9 * * 1-5

Both crons run at 9:30 am every Mon, Tue, Wed, Thurs, and Fri


15,45 7 * 4 TUE

At 7:15 am and 7:45 am every Tuesday in April


0 6,18 15 * *

At 6:00 am and 6:00 pm on the 15th day of every month


0 0 10/5 * *

At 00:00 on every 5th day-of-month from 10 through 31


Updated 2 months ago

Cron Expression Basics


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.