| Author |
Java Cron Jobs Stop for one hour a day.
|
pradeep gamage
Ranch Hand
Joined: Aug 03, 2009
Posts: 85
|
|
I am developing java application and in this i wanted to run some method periodically. I have used java schedule to run that method periodically. This is my Cron Expression.
.
This works fine. Now I wanted to stop running this scheduler for one hour per day. How I can write Cron Expression to do it? Give me a idea.
Thanks in advance
|
Software Engineer(BSC):SCJP 1.5
(Knowledge is power when applied)
|
 |
RatiKanta pal
Ranch Hand
Joined: Nov 13, 2011
Posts: 49
|
|
Hi Pradeep,
Could you please be more clear on whcih hour or any hour can do??
If thats the case(Any hour) you can write the trigger as "0 * 0-22 ? * *" which will trigger every day from 0 to 22th hour and will stop working for the 23rd hour.
|
 |
pradeep gamage
Ranch Hand
Joined: Aug 03, 2009
Posts: 85
|
|
I have done it like this way .
.
Its seem work fine.
Thanks for answer...
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9948
|
|
I would even say that is the CORRECT way to do it. It is obvious what is intended - that you don't want it to run from 1p - 2p
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
 |
|
|
subject: Java Cron Jobs Stop for one hour a day.
|
|
|