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

查看:191
本文介绍了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天全站免登陆