你多久做一次这样的事?- 0 * * * *


How often you do this in a cron? - 0 * * * *

0 * * * *

我使用crontab。这种情况在cron中发生的频率是多少?

它将每小时工作一次,正好在x点00分。

请记住crontab的格式是:

 +---------------- minute (0 - 59)
 |  +------------- hour (0 - 23)
 |  |  +---------- day of month (1 - 31)
 |  |  |  +------- month (1 - 12)
 |  |  |  |  +---- day of week (0 - 6) (Sunday=0 or 7)
 |  |  |  |  |
 *  *  *  *  *  command to be executed

所以第一个位置的0表示每分钟0,任何小时和天。

Cron还允许在开始处设置可选的秒范围。因此0 * * * * *表示每秒0,而0 * * * *表示每分钟0。