i would like to set up cron run at 4.30 am every five minutes for 3 hours so it would stop executing at 7.30, how to do it? would this work ??
*/5,30 4-7 * * *
thanks
feedback
|
This question came from our site for professional and enthusiast programmers.
|
I did a test on my server with the following setup:
Where the script crontest looked like this:
Here's the output:
So basically the setup you have will run every 5 minutes between the hours you have specified. All the 30 does is say to run it every 30 minutes, which is already does due to the 5 every minute interval. So it won't restrict the cron from running just from 0 to 30 minutes and then 5 minutes each in that interval. You might be able to solve it by restricting it like this:
Edit: This won't work either since the , means OR so it will still run every 5 minutes If this doesn't work then you'll probably have to solve it by:
| |||
feedback
|
|
You cannot specify time like you want on a single cron line
OR add something like this to your cron
| |||
|
feedback
|