rules.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <h3>Fields order</h3>
  2. <pre>
  3. +---------------- minute (0 - 59)
  4. | +------------- hour (0 - 23)
  5. | | +---------- day of month (1 - 31)
  6. | | | +------- month (1 - 12)
  7. | | | | +---- day of week (0 - 7) (Sunday=0)
  8. | | | | |
  9. * * * * *
  10. </pre>
  11. <p>Each of the patterns from the first five fields may be either * (an asterisk),
  12. which matches all legal values, or a list of elements separated by commas (see below).</p>
  13. <p>For "day of the week" (field 5), 0 is considered Sunday, 6 is Saturday
  14. (7 is an illegal value)</p>
  15. <p>A job is executed when the time/date specification fields all match the current
  16. time and date. There is one exception: if both "day of month" and "day of week"
  17. are restricted (not "*"), then either the "day of month" field (3) or the "day of week"
  18. field (5) must match the current day (even though the other of the two fields
  19. need not match the current day).</p>
  20. <h3>Fields operators</h3>
  21. <p>There are several ways of specifying multiple date/time values in a field:</p>
  22. <ul>
  23. <li>The comma (',') operator specifies a list of values, for example: "1,3,4,7,8"</li>
  24. <li>The dash ('-') operator specifies a range of values, for example: "1-6", which is equivalent to "1,2,3,4,5,6"</li>
  25. <li>The asterisk ('*') operator specifies all possible values for a field. For example, an asterisk in the hour time field would be equivalent to 'every hour' (subject to matching other specified fields).</li>
  26. <li>The slash ('/') operator (called "step") can be used to skip a given number of values. For example, "*/3" in the hour time field is equivalent to "0,3,6,9,12,15,18,21".</li>
  27. <li>The plus ('+') operator (called "offset") can be used as an offset to a given range. For example, "*/10+2" in the hour minute field is equivalent to "2,12,22,32,42,52".</li>
  28. </ul>
  29. <h3>Examples</h3>
  30. <pre>
  31. */15 * * * : Execute job every 15 minutes
  32. 0 2,14 * * *: Execute job every day at 2:00 and 14:00
  33. 0 2 * * 1-5: Execute job at 2:00 of every working day
  34. 0 12 1 */2 1: Execute job every 2 month, at 12:00 of first day of the month OR at every monday.
  35. </pre>