当前位置: 动力学知识库 > 问答 > 编程问答 >

Is there any way to specify periods with cron without setting up multiple instances?

问题描述:

I want a cron job to run between 7 AM and 10 PM, every day, at 5 minute intervals. Normally this would be okay if it was 5 minute intervals, because you could just use "/5", but is there a way to specify it as 5 minute intervals but skip the times between 10PM and 7AM?

网友答案:

The minutes are specified separately from the hours in crontab. Specify minutes using the periodic notation, and the hours as a range.

*/5 7-21 * * * /path/to/script
网友答案:

Below would help for Quartz scheduler

0 00/5 7-21 * * ?
分享给朋友:
您可能感兴趣的文章:
随机阅读: