How to run crontab job every week on Sunday

后端 未结 10 1084
忘掉有多难
忘掉有多难 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:18

    Following is the format of the crontab file.

    {minute} {hour} {day-of-month} {month} {day-of-week} {user} {path-to-shell-script}

    So, to run each sunday at midnight (Sunday is 0 usually, 7 in some rare cases) :

    0 0 * * 0 root /path_to_command
    

提交回复
热议问题