setup cron tab to specific time of during weekdays

前端 未结 3 1960
无人共我
无人共我 2020-12-13 22:59

I am trying to setup a cron job on a Ubuntu server. We want the cron job to run the script at certain times of the day and on some specific days of the week. For example, we

3条回答
  •  春和景丽
    2020-12-13 23:34

    In fact the last hour you want the script to run is 13:00 to 13:59, so you want:

    */2 9-13 * * 1-5 /path_to_script
    

    meaning the first runtime will be 9:00, then 9:02, and so on until 13:58 which will be the last run as 14:00 is not included.

提交回复
热议问题