Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run three cron jobs commands twice per hour (once every half hour) and the interval between these command should be 1-2 minutes. How should I configure cron jobs from cpanel?

share|improve this question
up vote 8 down vote accepted

I can't speak for cpanel, I'm afraid, but the crontab entries (if you can get to those) should look like this:

1,31 * * * *  /path/job1
3,33 * * * *  /path/job2
5,35 * * * *  /path/job3

That'll run each twice an hour, at 1, 3, and 5 minutes past the hour and half-hour.

share|improve this answer
Will the interval change from 2 to 3 minutes in this case: 1,31 * * * * /path/job1 4,33 * * * * /path/job2 7,35 * * * * /path/job3 – Levani Feb 8 '11 at 16:47
It'll change to three minutes for the ones that run after the hour, but not the ones that run after the half-hour. Try 1,31 / 4,34 / 7,37 for both. It's just the number of minutes past the hour that each job should run, with each job running at two different times past each hour - do you see the logic? – MadHatter Feb 8 '11 at 17:15

The interval between starting the jobs should be 2 minutes, or the interval from after one finishes 'til the next one starts should be 2 minutes?

If it's the first case, see MadHatter's comment.

If it's the second case, it's easiest to wrap the whole thing in a shell script, and do sleep 120 in between.

I'll often do this if the next task shouldn't fire off if the previous task didn't return cleanly. It also makes it easier to set a semaphore for the whole group of tasks so if a task gets hung, the next time it runs, you don't kick off the tasks again.

share|improve this answer
What Joe said, for the second case. Good point, Joe! – MadHatter Feb 8 '11 at 16:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.