The Cron time string is seven values separated by spaces:
Examples
| Sequence | Character | Values | Note |
|---|---|---|---|
| 1 | Second | 0 to 59 | * for all values, ? for no specific value |
| 2 | Minute | 0 to 59 | * for all values, ? for no specific value |
| 3 | Hour | 0 to 23 | * for all values, ? for no specific value |
| 4 | Day of Month | 1 to 31 | * for all values, ? for no specific value |
| 5 | Month | 1 to 12 | * for all values, ? for no specific value |
| 6 | Day of Week | 0 to 7 | * for all values, ? for no specific value |
| 7 | Year | - | - |
Examples
| Cron string | Description |
|---|---|
| 0 15 * * * * | Execute at 15 minutes past the hour, every hour. |
| 0 15 10 * * * | Execute at 10:15 am everyday. |
| 0 0 15 * * MON | Execute at 1:00 p.m on Monday's. |
| 0 */2 * * * * | Execute every two minutes. |
| 0 0 */5 * * * | Execute every five hour, on the hour. |
| 0 0/5 12,16,18 * * ? | Execute every 5 minutes start at 12pm till 12:55pm, repeat same for 16 and 18th hour |
| 0 10 12 01 11 ? | Execute at 12:10 on 01'st of November |
| 0 10 12 ? * 1#2 | Execute at 12:10 on the 2nd Monday |
No comments:
Post a Comment