-1

Now it's 3/12/2018 3:02:13 PM.

I have a cron expression 0 0 0/7 * * ? (every 7 hours starting at 00 am, of every day). As a result, executions:

 1. 3/12/2018 9:00 PM
 2. 3/13/2018 12:00 AM
 3. 3/13/2018 7:00 AM
 4. 3/13/2018 2:00 PM
 5. 3/13/2018 9:00 PM
 6. 3/14/2018 12:00 AM
 7. 3/14/2018 7:00 AM

As you can see, there were 3 hours between 1st, 2nd and 5th, 6th runs. Not 7.

Is it possible to make the rules run at the correct time, like this?

 1. 3/12/2018 9:00 PM
 2. 3/13/2018 4:00 AM
 3. 3/13/2018 11:00 AM
 4. 3/13/2018 6:00 PM
Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
  • This post appears to be [off-topic](http://stackoverflow.com/help/on-topic) as per *Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming.* Your question may be better suited for [Super User](http://superuser.com/) – Federico klez Culloca Mar 12 '18 at 13:29
  • 4
    I'm voting to close this question as off-topic because Title is not in english. – Fildor Mar 12 '18 at 13:29
  • 2
    Title aside, what's this got to do with Java? – Mena Mar 12 '18 at 13:34
  • Possible duplicate of [Running cron job on linux every 6 hours](https://stackoverflow.com/questions/11562804/running-cron-job-on-linux-every-6-hours) – M. Prokhorov Mar 12 '18 at 13:52
  • 1
    This cron does what you told it to: starting from 0:00 every seven hours (which *will* have jumps, because 24 is not a multiple of 7). – M. Prokhorov Mar 12 '18 at 13:54

1 Answers1

0

You are not starting "every 7 hours starting at 00 am" - you are starting in intervals of 7. I think. You should have a look at the documentation at https://help.ubuntu.com/community/CronHowto or the examples at http://www.baeldung.com/cron-expressions

Kai Adelmann
  • 199
  • 6
  • 15