|
| 1 | +<style type="text/css"> |
| 2 | + .zci--answer .crontab-container { |
| 3 | + max-height: 23.3ex; |
| 4 | + overflow-y: auto; |
| 5 | + } |
| 6 | + .zci--answer .crontab-container .crontab-column { |
| 7 | + width: 48%; |
| 8 | + display: inline-block; |
| 9 | + vertical-align:top; |
| 10 | + } |
| 11 | + .zci--answer .crontab-container .crontab-column:first-child { |
| 12 | + margin-right: 3%; |
| 13 | + } |
| 14 | + .zci--answer .crontab-container p, |
| 15 | + .zci--answer .crontab-container .crontab-column { |
| 16 | + padding-top: 0; |
| 17 | + padding-bottom: 2ex; |
| 18 | + } |
| 19 | + .zci--answer .crontab-container table { |
| 20 | + width: 100%; |
| 21 | + } |
| 22 | + .zci--answer .crontab-container th { |
| 23 | + font-weight: bold; |
| 24 | + } |
| 25 | + .zci--answer .crontab-container td { |
| 26 | + vertical-align: top; |
| 27 | + } |
| 28 | + .zci--answer .crontab-container dd { |
| 29 | + margin-bottom: 1ex; |
| 30 | + } |
| 31 | + @media(max-width: 704px) { |
| 32 | + .zci--answer .crontab-container .crontab-column { |
| 33 | + width: 100%; |
| 34 | + margin-right: 0; |
| 35 | + display: block; |
| 36 | + } |
| 37 | + } |
| 38 | +</style> |
| 39 | +<div class="crontab-container"> |
| 40 | + <div class="crontab-column"> |
| 41 | + <p>Commands are executed by cron when the minute, hour, and month |
| 42 | + fields match the current time, and at least one of the two day fields |
| 43 | + (day of month, or day of week) match the current time. A field may be |
| 44 | + an asterisk (<code>*</code>), which will always match.</p> |
| 45 | + <table> |
| 46 | + <tr><th>Field</th><th>Allowed values</th> |
| 47 | + <tr><td>minute</td><td>0-59</td></tr> |
| 48 | + <tr><td>hour</td><td>0-23</td></tr> |
| 49 | + <tr><td>day of month</td><td>1-31</td></tr> |
| 50 | + <tr><td>month</td><td>1-12 or first three letters</td></tr> |
| 51 | + <tr><td>day of week</td><td>0-7 or first three letters<br>(0 or 7 is Sunday)</td></tr> |
| 52 | + </table> |
| 53 | + </div> |
| 54 | + <div class="crontab-column"> |
| 55 | + <b>Examples</b> |
| 56 | + <dl> |
| 57 | + <dt>Run every Tuesday at 2:30</dt> |
| 58 | + <dd><code>30 2 * * tue /path/to/command</code></dd> |
| 59 | + <dt>Run every 10 minutes</dt> |
| 60 | + <dd><code>*/10 * * * * /path/to/command</code></dd> |
| 61 | + <dt>Run every 2 hours, on the half hour</dt> |
| 62 | + <dd><code>30 */2 * * * /path/to/command</code></dd> |
| 63 | + <dt>Run every 2 hours, on the half hour, but only on weekdays</dt> |
| 64 | + <dd><code>30 */2 * * 1-5 /path/to/command</code></dd> |
| 65 | + <dt>Run at 12:05, 13:05, ..., and 18:05</dt> |
| 66 | + <dd><code>5 12-18 * * * /path/to/command</code></dd> |
| 67 | + <dt>Run at 12:05, 14:05, 16:05, and 18:05</dt> |
| 68 | + <dd><code>5 12-18/2 * * * /path/to/command</code></dd> |
| 69 | + <dt>Run on the first day of every month, at midnight</dt> |
| 70 | + <dd><code>0 0 1 * * /path/to/command</code></dd> |
| 71 | + <dt>Run on the first day of every third month, at midnight</dt> |
| 72 | + <dd><code>0 0 1 */3 * /path/to/command</code></dd> |
| 73 | + </dl> |
| 74 | + </div> |
| 75 | +</div> |
0 commit comments