我正在尝试在 Ubuntu 服务器上设置 cron 作业。我们希望 cron 作业在一天中的某些时间和一周中的某些特定日子运行脚本。例如,我们想设置一个按以下顺序运行脚本的 cron 作业:
Execute the script every 2 minutes from 9 am to 2 pm during the weekdays.
这是我迄今为止能够做到的:
*/2 09-14 * * * /path_to_script
工作日我应该做什么?
最佳答案
和你几个小时一样:
*/2 09-18 * * 1-5 /path_to_script
0
和 7
代表星期日
6
代表星期六
所以,1-5
表示从星期一到星期五
https://stackoverflow.com/questions/14436953/