How to run cron job Conditionally - 5min, 5 min, 10 min, 5min, 5min, 10mi

4/17/2020

I have a task to run cron job in 5min for two times than in 10min...

This sequence should be continued... like. 5,5,10,5,5,10,5,5,10.....

How can we achieve this?

Thanks

-- Iceman
cron
cron-task
kubernetes-cronjob

1 Answer

4/17/2020

Since a {5, 5, 10} gap cycle is 20 minutes (an nice integral factor of 60 minutes), I'd just opt for a crontab entry of:

0,5,10,20,25,30,40,45,50 * * * * * commandToExecute
-- paxdiablo
Source: StackOverflow