* "0 0 * * * *" = the top of every hour of every day.
* "*/10 * * * * *" = every ten seconds.
* "0 0 8-10 * * *" = 8, 9 and 10 o'clock of every day.
* "0 0 8,10 * * *" = 8 and 10 o'clock of every day.
* "0 0/30 8-10 * * *" = 8:00, 8:30, 9:00, 9:30 and 10 o'clock every day.
* "0 0 9-17 * * MON-FRI" = on the hour nine-to-five weekdays
* "0 0 0 25 12 ?" = every Christmas Day at midnight
Cron表达式由六个字段表示:
second, minute, hour, day of month, month, day(s) of week
(*)表示匹配任何
*/X表示“每个X”
? ("no specific value") -当你需要在允许字符的两个字段之一中指定某项内容时,非常有用。例如,如果我想让触发器在一个月的某一天(比如,10号)触发,但我不关心这一天是星期几,我将在月的第一天字段中输入“10”,在星期的第一天字段中输入“?”。