Cron Job Timing Help

Status
Not open for further replies.

jitensuthar27

New Member
Messages
4
Reaction score
0
Points
0
Hey guys,

I'm fairly new to the whole cron job thing (especially the formatting of the timing). I have two cron jobs set up for PHP list, but basically I want to make sure the timings are correct with X10Hosting's free account limitations.

Here are just the time portions of the cron jobs:

*/5 00-02,04-23 * * *
30 03 * * *

So what I was shooting for is this: Run the 1st job every 5 minutes for every hour EXCEPT at 3 AM. Then, at 3:30AM run the second cron. Actually, it would be better if I can have it run the 1st job every 5 minutes except from like 3:00-3:10 AM where I'll be running the 2nd cron. Basically, I'm trying to fit in the 2nd cron while still keeping the minimum spacing of 5 minutes between jobs. The problem is that I want the first one to run every 5 minutes but I need a small gap to run the 2nd one once a day. Any better way to do this?

Thanks!
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Code:
*/5 00-02,04-23 * * *  JobA
0-25,35-55 3 * * *       JobA
30 03 * * *                 JobB

Split JobA into two commands. One for the 3 o'clock hour, and one for the rest.
 

jitensuthar27

New Member
Messages
4
Reaction score
0
Points
0
Hadn't even thought of that!

Just a quick question though.... Does that second line for Job A still run every 5 minutes? There doesn't seem to be any indication in the timing format that it does?

Thanks again
 
Last edited:
Status
Not open for further replies.
Top