英文:
Running a job during specific times of the day
问题
I am writing a code to run a job during specific time frames of weekdays. I.e., I need this job to run every 5 mins between 9 AM to 5 PM on weekdays. I could achieve this behavior by programmatically scheduling and disabling the job. Is there any out of the box option available to achieve similar behavior?
英文:
I am writing a code to run a job during specific time frames of weekdays. I.e i need this job to run every 5 mins between 9 AM to 5 PM on weekdays. I could achieve this behavior by programmatically scheduling and disabling the job. Is there any out of the box option available to achieve similar behavior?
答案1
得分: 0
我可以使用以下的 cron 表达式来实现这个。Cron 表达式很强大!
0 0/2 9-16 ? * SUN,MON,TUE,WED,THU *
英文:
I could achieve this with help of below cron expression. Cron expressions rock !!
0 0/2 9-16 ? * SUN,MON,TUE,WED,THU *
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论