0

I have a job scheduled via Quartz and a CRON Expression. The goal of my CRON expression is to run every 10 minutes every day between Monday and Friday between 08:00 AM and 20:00 PM and looks like this:

0 0/10 8-19 ? * MON-FRI

My execution log looks like this:

2010-02-24 19:10:00,140 INFO  - Start
2010-02-24 19:20:00,015 INFO  - Start
2010-02-24 19:30:00,015 INFO  - Start
2010-02-24 19:40:00,015 INFO  - Start
2010-02-24 19:50:00,000 INFO  - Start //Execution expected at 20:00 PM
2010-02-25 08:00:00,000 INFO  - Start
2010-02-25 08:10:00,000 INFO  - Start
2010-02-25 08:20:00,000 INFO  - Start
2010-02-25 08:30:00,000 INFO  - Start
2010-02-25 08:40:00,000 INFO  - Start
2010-02-25 08:50:00,000 INFO  - Start
2010-02-25 09:00:00,000 INFO  - Start
2010-02-25 09:10:00,000 INFO  - Start

I would like that my CRON expression will fire my job at 20:00 PM. Question: Can this be accomplished using one CRON expression? which one?

1 Answer 1

2

Why should it run at 20:00? You specify that the hour should be 8-19, so 20:00 doesn't match that. I am not sure if there can be a single line cron expression to accomplish your needs, but you could easily add a line

0 20 * * * ...

in addition to the existing one, that should do the trick.

2
  • Thanks for your reply, actually my "workaround" is just using two cron expressions. My question is just for improving my skills. Feb 25, 2010 at 10:11
  • 1
    That example is incorrect. That example will fire off at midnight of the 20th day of the month, NOT at 20:00 every day.
    – Magellan
    Jul 24, 2012 at 4:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .