File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Cron Jobs Stop for one hour a day.

 
pradeep gamage
Ranch Hand
Posts: 85
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
RatiKanta pal
Ranch Hand
Posts: 84
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 85
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have done it like this way .
.
Its seem work fine.

Thanks for answer...
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12020
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic