Cron - Setting to run every certain hours between certain hours

Avatar
  • updated
  • Answered

Link:   I found this example (see link), but when I entered the setting, I received an error (see img).


Image 97

Avatar
Howard

Thanks, I used the alternative setting.

Avatar
IMH Support Agent 2
Quote from Howard

I am re-stating the original question. It appears that we both know the correct setting since the start of this thread. How do you create a cron job with this setting using the inmotion cPanel tool provided (please see my screen shot). I have inserted 8-17/2 for the hour and I get an error.


Hello Howard,

Sorry for the continued confusion on this issue. The short answer is that "yes" the nomenclature that you're using is correct.  However, cPanel's cron job interface just doesn't like it - for whatever reason.  I've asked around and researched online to see if I could find anything documented - so far nothing.  What you can do for now is a work around for the hour entry.  Just list the hours where you want the cron job to run.  So, the entry would look like:  8,10,12,14,16  .  You can submit a ticket to our live technical support team.  They would need all of the details of your account and server to investigate.  I think the issue would need to be submitted to the cPanel developers.  I was getting the same error when putting in the values in my test account. If you're on a VPS/dedicated server with root access, it's possible to edit the cron jobs manually in a terminal. Currently, we believe the issue to be cPanel specific. 


Apologies again that we can't provide a direct answer!  If you have any further questions or comments, please let us know.


Kindest regards,

Arnel C.

Avatar
Howard

I am re-stating the original question. It appears that we both know the correct setting since the start of this thread. How do you create a cron job with this setting using the inmotion cPanel tool provided (please see my screen shot). I have inserted 8-17/2 for the hour and I get an error.


Avatar
IMH Support Agent 2
Quote from Howard

Arnel,

Thanks for the response. In my example 17 is 24-hour time. Have I missed something?

I am trying to run the job between 8am and 5pm every other hour per the example in the link.

The formatting is incorrect for the hour.  It should be 8-17 for the hour.  If you want a great way to check your cron job format, check out this link. Just make sure to include the * for all the values.  For example, I tested your original one like this:

* 8-17/2 * * *

And the tool interpreted it as At every minute past every 2nd hour from 8 through 17.

I was shown this a little earlier after posing the question to one of my co-workers. Best tool I've seen for cron jobs!


Hope that helps!

If you have any further questions or comments, please let us know.

Kindest regards,

Arnel C.

Avatar
Howard

Arnel,

Thanks for the response. In my example 17 is 24-hour time. Have I missed something?

I am trying to run the job between 8am and 5pm every other hour per the example in the link.

Avatar
IMH Support Agent 2
  • Answered

Hello Howard,

Sorry for the issues with the cron job.  The error message is telling you where the error is occurring.  The hour is incorrectly configured.  It should be set up based on 24-hour time.  You can see more documentation here

If you have any further questions or comments, please let us know.


Kindest regards,

Arnel C.