Quartz在特定时间开始并以特定间隔运行 [英] Quartz start at a specific time and run at specific interval

查看:638
本文介绍了Quartz在特定时间开始并以特定间隔运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图想出一个cron表达式,在上午8点30分开始工作,每30分钟运行一次,直到午夜,并在第二天早上8点30分重新启动。我提出了以下表达,但只有缺少的是从上午8点30分开始。它不是从8.30开始,而是从8.00开始。

I have been trying to come up with a cron expression to start a job at 8.30am and run every 30 mins until midnight and restart at 8.30am next day. I came up with following expression but only thing it lacks is starting at 8.30am. Rather than starting at 8.30 it starts at 8.00.


0 0/30 8/1 * *?

0 0/30 8/1 * * ?

甚至可以做我想做的事情吗?我将使用java quartz2.x.x

Is it even possible to do what I'm trying to do? I'll be using java quartz2.x.x

推荐答案

在单个表达式中似乎不可能。有很好的链接,要创建你的cron表达式,你可以参考 Cron Maker

It seems to be not possible in single expression. There is good link, to create your cron expression, you may refer Cron Maker

==已更新==

您可以拥有两个cron表达式

You can have two cron expression

0 30/30 8 ? * * *   //every day 8:30

并且,

0 0/30 9-23 * * ?  // every 30 min starts from 9:00

这篇关于Quartz在特定时间开始并以特定间隔运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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