1

I know how to run a job at every 30 minutes is by using following cron expression:

0 0/30 * * * ?

It runs the job at every 30 minutes like ::

10:30, 11, 11:30, 12.

I want to make it run every after 30 minutes quarter past the hours like::

10:15, 10:45, 11:15, 11:45.

How do I make it run every after 30 minutes quarter past the hours as explained above?

UPDATE :: I have seen that link. The solution stated in the given link is not working. It started cron job at quarter past hour but It is running on every second of the minute like 15:15:00, 15:15:01, 15:15:02.....

Thanks

priyank
  • 148
  • 3
  • 16
  • do you need the job to start/end at a specific time / only run on specific days etc? – Peter Jun 08 '16 at 10:21
  • not at any specific time/day... just like i have mentioned .. all days .. Just want to run it like 10:45, 11:15.........instead of 10:30, 11. – priyank Jun 08 '16 at 10:33
  • Possible duplicate of [Run Cron job every N minutes plus offset](http://stackoverflow.com/questions/12786410/run-cron-job-every-n-minutes-plus-offset) – fedorqui Jun 08 '16 at 10:50

3 Answers3

4

Just give it a minute value of 15,45

as in

0 15,45 * * * ? *

see www.cronmaker.com

fedorqui
  • 275,237
  • 103
  • 548
  • 598
Scary Wombat
  • 44,617
  • 6
  • 35
  • 64
2

Try this,15 means start time:

0 15/30 * * * ?
fedorqui
  • 275,237
  • 103
  • 548
  • 598
Gabriel.ge
  • 168
  • 3
  • 15
  • It started cron job at quarter past hour but It is running on every second of the minute like 15:15:00, 15:15:01, 15:15:02..... – priyank Jun 08 '16 at 09:49
1

Another variant of the answers already provided is:

0 15-45/30 * * * ?

Which when tested with CronMaker gave me the below results (Note the different start times):

enter image description here enter image description here

As you've had some issues with the other cron expressions, I scheduled a job with the above and it has been running fine

Peter
  • 1,592
  • 13
  • 20