0

I am stuck and seek your help for my requirement , where I need to run a job everyday except on Sunday mornings from 05:30 AM to 08:30 AM.

I have searched and could not see the solution for my problem, could you be able to help me out to get the correct Cron Expression. I have also tried it using http://www.cronmaker.com/

Nicktar
  • 5,548
  • 1
  • 28
  • 43
Jaffar
  • 3
  • 2
  • Maybe [this](https://www.freeformatter.com/cron-expression-generator-quartz.html) is a better cron maker. Try this and let us know how it went. – user1234SI. Jan 28 '20 at 06:34
  • Does this answer your question? [How to skip the cron job in saturday and sunday in linux?](https://stackoverflow.com/questions/9143965/how-to-skip-the-cron-job-in-saturday-and-sunday-in-linux) – Stultuske Jan 28 '20 at 06:35
  • what time of the day, you run your job? – Reyhaneh Torab Jan 28 '20 at 06:35
  • It needs to be running continuously except those timings given above. – Jaffar Jan 29 '20 at 07:06

2 Answers2

0

i think the easiest solution in cron is:

  1. start your program without any limit

  2. stop your code at 5:30 AM on sundays

    30 5 * * 7 stop_code

  3. start your code at 8:30 Am on sundays

    30 8 * * 7 start_code_again

Reyhaneh Torab
  • 360
  • 5
  • 9
  • this would be a terrible solution. You would have the application either executed one time: at 8:30 on sundays, or it would be active constantly, but you would have to check in the code itself for when to run. – Stultuske Jan 28 '20 at 07:29
0

Thank you all for your response.

I have used a CronRoutePolicy with respect to Camel as we were using Camel.

In the route policy i could define Start time , Suspend Time and Resume Time.

I have deployed it but some how quartz has not started the job. Figuring out the issue now.

Jaffar
  • 3
  • 2