cronExpression 0 * * * *?

cronExpression 0 * * * *?

请告诉我“0 * * * *”是什么意思?在 cronExpression.

<bean id="batchJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
    <property name="jobDetail" ref="batchJobDetail"/>    
    <property name="cronExpression">
        <value>0 * * * * ?</value>
    </property>
</bean>

表示"do this job at the beginning of every hour."

From Wikipedia:

# ┌───────────── min (0 - 59)
# │ ┌────────────── hour (0 - 23)
# │ │ ┌─────────────── day of month (1 - 31)
# │ │ │ ┌──────────────── month (1 - 12)
# │ │ │ │ ┌───────────────── day of week (0 - 6) (0 to 6 are Sunday to
# │ │ │ │ │                  Saturday, or use names; 7 is also Sunday)
# │ │ │ │ │
# │ │ │ │ │
# * * * * *  command to execute

问号不规范,我认为它不适用于这种情况。从 this Whosebug answer's reference to this webpage,我们发现:

? ("no specific value") - useful when you need to specify something in one of the two fields in which the character is allowed, but not the other. For example, if I want my trigger to fire on a particular day of the month (say, the 10th), but don't care what day of the week that happens to be, I would put "10" in the day-of-month field, and "?" in the day-of-week field.

第二分钟时间月日月日星期年(可选)

0 * * * * 每个月的每一天的每一分钟的第一秒

? 未指定特定值。当您需要为 Day-of-month 或 Day-of-week 两个字段之一指定一个值而不是另一个时,这很有用。

0 * * * * ?
表示 "every 1 minute"