crontab 在某些小时之间每 15 分钟运行一次 [英] crontab run every 15 minutes between certain hours
问题描述
这是否正确安排在 07:00 和 19:00 之间每 15 分钟运行一次?
*/15 07-19 * * */path/script
你的命令没问题!
要从 7.00 运行到 19.45,每 15 分钟只需使用 */15
如下:
*/15 07-19 * * */path/script^^^^ ^^^^^
也就是说,分钟列中的内容 */15
将每 15 分钟做一次,而第二列,小时,将在指定的小时范围内做那件事.>
如果你想让它运行到 19.00 那么你必须写两行:
*/15 07-18 * * */path/script0 19 * * */路径/脚本
您可以在 crontab.guru 中获得该命令的完整说明:https://crontab.guru/#/15_7-19___
Is this correct scheduled to run between 07:00 and 19:00 at every 15 minutes?
*/15 07-19 * * * /path/script
Your command is fine!
To run from 7.00 until 19.45, every 15 minutes just use */15
as follows:
*/15 07-19 * * * /path/script
^^^^ ^^^^^
That is, the content */15
in the minutes column will do something every 15 minutes, while the second column, for hours, will do that thing on the specified range of hours.
If you want it to run until 19.00 then you have to write two lines:
*/15 07-18 * * * /path/script
0 19 * * * /path/script
You can have a full description of the command in crontab.guru: https://crontab.guru/#/15_7-19___
这篇关于crontab 在某些小时之间每 15 分钟运行一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!