本文介绍了仅在上午10点至下午5点之间每分钟执行一次cron作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您如何仅在办公时间(上午10点至下午5点)之间每分钟执行一次cron作业

How do you run a cron job every minute only between office hours(10 am to 5pm)

我检查了此线程,但它没有回答我的问题。

I checked this thread Run a cron job every minute only on specific hours? but it doesn't answer my questions.

推荐答案

这应该是正确的:

* 10-16 * * 1-5 /path/to/my-script

因此,每个月的每一分钟,即星期一至星期五之间(包括星期一至星期五)的每一天,包括上午10点至下午5点。显然,办公时间是一个模糊的表述,很多人还有其他时间表;-)

So every single minute, between and including 10am and 5pm, every day in every month that is a day between and including monday to friday. Obviously "office hours" is a fuzzy expression, many people have other schedules ;-)

不幸的是,我看不到一个简单的解决方案来使脚本也恰好在下午5点执行...

Unfortunately I fail to see an easy solution to get the script executed also exactly on 5pm...

这篇关于仅在上午10点至下午5点之间每分钟执行一次cron作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 00:01