2

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 * * ?

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

sYl3r
  • 393
  • 5
  • 16
  • @sYI3r This is possible if you refer this site **Cron Trigger Tutorial** [link](http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html) – Kaviranga Mar 23 '17 at 03:58
  • Hi @Kaviranga, if I'm going with 0 30/30 8/1 * * ? it simply won't run at 9.00 10.00 ... only way I can get it is 0 30/29 8/1 * * ? and let it at at 8.59 and 9.59. Do you have the solution to what I'm looking for? – sYl3r Mar 23 '17 at 04:15
  • @sYI3r If you are test this on a JSF web form open **quartz-config.xml** and include this line inside tags **0 0/30 8/1 * * ?** . I've got this idea fron this site [link](https://www.mkyong.com/jsf2/jsf-2-quartz-2-example/). – Kaviranga Mar 23 '17 at 05:29
  • 1
    @kaviranga With this expression it will start the trigger at 8.00am not 8.30am. That's the issue. It's quite interesting if no one has came across this issue before. – sYl3r Mar 23 '17 at 06:32

1 Answers1

2

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

==Updated==

You can have two cron expression

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

And,

0 0/30 9-23 * * ?  // every 30 min starts from 9:00
Ravi
  • 30,829
  • 42
  • 119
  • 173
  • Thanks for the link @Ravi, yes I have been using this web site to see next schedule dates. And I can't seems to come up with a expression for this specific scenario. – sYl3r Mar 23 '17 at 05:08
  • Please check my update answer, let me know, if it is helpful. – Ravi Mar 23 '17 at 05:39