Snooper Cron event
The Cron format is a well-know powerful and flexible way to define time and frequency of an event.
Cron format
The fields in a Cron expression have the following order, separated by a space:
[seconds] [minutes] [hours] [day-of-month] [month] [day-of-week] [year]
Field constraints
Field | Allowed values | Allowed control symbols |
---|---|---|
Seconds | 0-59 | , - * / |
Minutes | 0-59 | , - * / |
Hours | 0-23 | , - * / |
Day of month | 1-31 | , - * ? / L |
Month | 1-12, JAN-DEC | , - * / |
Day of week | 1-7,MON-SUN | , - * ? / L |
Year | empty or 1970-2099 | , - * / |
Control symbols
Symbol | Description |
---|---|
* | Any value |
? | No specific value |
- | Range of values |
R | Random value within allowed value range |
/ | Step values |
L | Last (last day of month etc) |
Cron expression examples
Expression | Meaning |
---|---|
0 0/5 * ? * * * | Fire every 5 minutes every hour every day |
0 * * ? * * | Fire every minute every hour every day |
0 0 12 * * ? | Fire at 12 (noon) every day |
0 15 14 ? * * | Fire at 14:15 every day |
0 15 14 * * ? 2018 | Fire at 14:15 every day during the year 2018 |
0 * 14 * * ? | Fire every minute starting at 14 and ending at 14:59, every day |
0 0 6 ? * MON | Fire every Monday at 06:00. |
0 15 10 15 * ? | Fire at 10:15 on the 15th day of every month |
0 0/5 14 * * ? | Fire every 5 minutes starting at 14 and ending at 14:55, every day |
0 0 22 ? * 1-5 | Fire at 22:00 on Mon, Tue, Wed, Thu and Fri. |
0 15 10 L * ? | Fire at 10:15 on the last day of every month |
0 0 0/1 ? * * | Fire every hour every day |