Next: , Previous: , Up: Features   [Contents][Index]


5.4 Day Field Semantics

In a crontab schedule, the day of a command’s execution can be specified by two fields: day of month (field 3), and day of week (field 5). If both fields are restricted (i.e. are not ‘*’), their interpretation differs between various cron implementations. Vixie cron will run the command when either field matches the current time (the fields are thus joined by a logical OR). Dillon’s cron interprets the 3rd field as an ordinal number of weekday in month (so that allowed numeric values of the 3rd field in this case are 1-5). Consider for example the following schedule:

0 11 1,4 * 1-3

For Vixie cron, this means “run the command on each 1st and 4th day of the month as well as on each Monday, Tuesday and Wednesday”. The meaning of this schedule for Dillon’s cron is: “run the command on each first and fourth Monday, Tuesday and Wednesday in the month”.

The semantics used by micron is configurable. By default it assumes the two fields to be joined by a logical AND, i.e. the example above would mean “each first and fourth day of the month if the day of week is Monday, Tuesday or Wednesday”. The use of Vixie or Dillon semantics can be requested by setting the _MICRON_DAY_SEMANTICS variable in the crontab. For example, the line:

_MICRON_DAY_SEMANTICS = Vixie

requests the semantics used by Vixie cron.

See _MICRON_DAY_SEMANTICS, for a detailed description of this variable.