Oozie scheduling examples
You can use cron scheduling in Oozie to ensure that the jobs run according to the criteria that you specify.
The following examples show cron scheduling in Oozie. Oozie's processing time zone is UTC. If you are in a different time zone, add to or subtract from the appropriate offset in these examples.
- Run at the 30th minute of every hour
- Set the minute field to
30
and the remaining fields to*
so they match every value.frequency="30 * * * *"
- Run at 2:30 p.m. every day
- Set the minute field to
30
, the hour field to14
, and the remaining fields to*
.frequency="30 14 * * *"
- Run at 2:30 p.m. every day in February
- Set the minute field to
30
, the hour field to14
, the day-of-month field to*
, the month field to2
(February), and the day-of-week field to*
.frequency="30 14 * 2 *"
- Run every 20 minutes between 5:00-10:00 a.m. and between 12:00-2:00 p.m. on the fifth day of each month
- Set the minute field to
0/20
, the hour field to5-9,12-13
, the day-of-month field to0/5
, and the remaining fields to*
.frequency="0/20 5-9,12-13 0/5 * *"
- Run every Monday at 5:00 a.m.
- Set the minute field to
0
, the hour field to5
, the day-of-month field to?
, the month field to*
, and the day-of-week field toMON
.frequency="0 5 ? * MON"
- Run on the last day of every month at 5:00 a.m.
- Set the minute field to
0
, the hour field to5
, the day-of-month field toL
, the month field to*
, and the day-of-week field to?
.frequency="0 5 L * ?"
- Run at 5:00 a.m. on the weekday closest to the 15th day of each month
- Set the minute field to
0
, the hour field to5
, the day-of-month field to15W
, the month field to*
, and the day-of-week field to?
.frequency="0 5 15W * ?"
- Run every 33 minutes from 9:00-3:00 p.m. on the first Monday of every month
- Set the minute field to
0/33
, the hour field to9-14
, the day-of-week field to2#1
(the first Monday), and the remaining fields to*
.frequency="0/33 9-14 ? * 2#1"
- Run every hour from 9:00 a.m.-5:00 p.m. on weekdays
- Set the minute field to
0
, the hour field to9-17
, the day-of-month field to?
, the month field to*
, and the day-of-week field to2-6
.frequency="0 9-17 ? * 2-6"
- Run on the second-to-last day of every month
- Set the minute field to
0
, the hour field to0
, the day-of-month field toL-1
, the month field to*
, and the day-of-week field to?
.frequency="0 0 L-1 * ?"
Oozie uses Quartz, a job scheduler library, to parse the cron syntax. For more examples, go to the CronTrigger Tutorial on the Quartz website. Quartz has two fields (second and year) that Oozie does not support.