How to run crontab job every week on Sunday

后端 未结 10 1118
忘掉有多难
忘掉有多难 2020-12-02 04:07

I\'m trying to figure out how to run a crontab job every week on Sunday. I think the following should work, but I\'m not sure if I understand correctly. Is the following cor

10条回答
  •  广开言路
    2020-12-02 04:39

    When specifying your cron values you'll need to make sure that your values fall within the ranges. For instance, some cron's use a 0-7 range for the day of week where both 0 and 7 represent Sunday. We do not(check below).

    Seconds: 0-59
    Minutes: 0-59
    Hours: 0-23
    Day of Month: 1-31
    Months: 0-11
    Day of Week: 0-6
    

    reference: https://github.com/ncb000gt/node-cron

提交回复
热议问题