简体   繁体   中英

Scheduling many cron jobs to run every 5 min but not in the same time

I'm using cron to run many processes every 5 min. It looks like this:

*/5       *       *       *       *       execute task1
*/5       *       *       *       *       execute task2
*/5       *       *       *       *       execute task3
*/5       *       *       *       *       execute task4
*/5       *       *       *       *       execute task5
*/5       *       *       *       *       execute task6

and so forth....

This cause all take to run in the same time. Is there away I can make sure all will be spread within the 5 min time spread? Meaning, let say its now 0:00 so: task1 will run at 0:00 and task2 at 0:01, task3 at 0:02 and task7 will also run at 0:00 (like take1).

Or any other way I can spread out the tasks with in the 5 min time.

How about 0/5 or 1/5 or 2/5 etc in the minute field? Meaning every five minutes staring at 0, 1 or 2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM