用Cron表情每天在不同时间运行两次? [英] Cron expression to run job twice a day at different time?

查看:1466
本文介绍了用Cron表情每天在不同时间运行两次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一项工作需要每天在不同的时间执行两次。
例如10:00和15:30。
我该如何实现呢?

I have one job that needs to be execute twice a day at different time . e.g. 10:00 and 15:30. How can i achieve this ?

我很困惑,因为分钟在两个时间上都是不同的。
对于11:00和15:00很容易,因为在这两个时间中,分钟部分都相同,但是对于不同的分钟部分,使用cron是否可行?

I am confuse because minute is different for both the time. For 11:00 and 15:00 its easy because for both the times, minute portion is same, but for the different minute portion is it feasible with cron ?

感谢提前提出的歉意,并对这个愚蠢的问题表示歉意。

Thanks in Advance and apologies for silly question.

推荐答案

尝试以下操作,您将在一个表达式中获得最接近的结果

Try following which you will get closest in one expression

0 0 10,15/12 * * ?

这将运行10:00和15:00。

this will run 10:00 and 15:00.

这篇关于用Cron表情每天在不同时间运行两次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆