Scheduling in Oozie using cron-like syntax
Most Linux distributions include the cron utility, which is used for scheduling time-based jobs. You can schedule Oozie using Cron-like syntax.
Set the scheduling information in the
attribute of the coordinator.xml file. A simple
file looks like the following example. The frequency attribute and
scheduling information appear in bold.
<coordinator-app name="MY_APP" frequency="30 14 * * *" start="2009-01-01T05:00Z" end="2009-01-01T06:00Z" timezone="UTC" xmlns="uri:oozie:coordinator:0.5"> <action> <workflow> <app-path>hdfs://localhost:8020/tmp/workflows</app-path> </workflow> </action> </coordinator-app>
Syntax and structure
The cron-like syntax used by Oozie is a string with five space-separated fields:
The structure takes the form of
* * * * *. For
30 14 * * * means that the job runs at at 2:30
p.m. everyday. The minute field is set to
30, the hour
field is set to
14, and the remaining fields are set to
Allowed values and special characters
The following table describes special characters allowed and indicates in which fields they can be used.
||All||Match all values.|
||All||Specify multiple values.|
||All||Specify a range.|
||All||Specify an increment.|
||Day-of-month, day-of-week||Indicate no specific value (for example, if you want to specify one but not the other).|
||Day-of-month, day-of-week||Indicate the last day of the month or the last day of the
week (Saturday). In the day-of-week field,
||Day-of-month||Indicate the nearest weekday to the given day.|
||Day-of-week||Indicate the nth day of the month|
The following table summarizes the valid values for each field.
|Field||Allowed Values||Allowed Special Characters|
|Month||1-12 or JAN-DEC||
|Day-of-week||1-7 or SUN-SAT||