CRON expression.
Cron-Expressions are used to configure instances of CronTrigger. Cron-Expressions are strings
that are actually made up of seven sub-expressions, that describe individual details of the schedule. These
sub-expression are separated with white-space, and represent:- Seconds
- Minutes
- Hours
- Day-of-Month
- Month
- Day-of-Week
- Year (optional field)
+-------------------- second (0 - 59)
| +----------------- minute (0 - 59)
| | +-------------- hour (0 - 23)
| | | +----------- day of month (1 - 31)
| | | | +-------- month (1 - 12)
| | | | | +----- day of week (0 - 6) (Sunday=0 or 7)
| | | | | | +-- year [optional]
| | | | | | |
* * * * * * * command to be executed
Examples.
1. For every 10 seconds
0/10 * * 1/1 * ?
2. For every Sunday midnight at 23:00
0 0 23 ? * SUN
Some of the frequently used schedules
You can play with http://www.cronmaker.com/ website for more number of combinations.
Cron Expression Examples
| |||||||||||||||||||||||||||||||||||||||||
Comments
Post a Comment