How to skip the cron job in saturday and sunday in linux? [closed]

妖精的绣舞 提交于 2020-01-30 14:20:49

问题


Hi I want to setup a cron job in linux excluding saturday and sunday.


回答1:


Begin the line with 0 0 * * 1,2,3,4,5 <user> <command>. The first fields are minutes and hours. In this case the command will run at midnight. The stars mean: for every day of the month, and for every month. The 1 to 5 specify the days. monday to friday. 6=saturday 0=sunday.




回答2:


Try this:

# run every two hours at the top of the hour Monday through Friday
0 */2 * * mon-fri <command>


来源:https://stackoverflow.com/questions/9143965/how-to-skip-the-cron-job-in-saturday-and-sunday-in-linux

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!