Ever month we redeploy server images, and this results in 30 minutes to two hours of down time. And every time I have have to manually go through the cron tabs on our batch server to manually run any crons missed during the downtime.

Is there an automated way of doing this? Something where I can specify a start time, end time, and the cron tab and then the script would run each cron once that should have run in that time window.

Before I go through the effort of writing something to parse the crontab, I'm hoping something like this already exists.

This is for linux hosts in AWS (both Ubuntu 18.04 and AZN Linux).


  • Are the system systemd based? Can you switch over to using systemd timers? Pretty sure with timers, you can have it automatically reschedule, depending on how you configure the timer. There are also a bunch of other cron replacements that are a lot smarter. Maybe look to see if one of them doe what you need? – Zoredache Feb 21 at 20:06
  • Another thought, how are your crontabs being created in the first place? If you are creating them via ansible/puppet/etc, it sure seems like your configuration management tool could be used to fire off a bunch of one-off jobs or something. – Zoredache Feb 21 at 20:09

Not with just cron, which only knows about the present. Either make your own scripts smarter about missing an interval, or port them to a different scheduler.

Typical options packaged by Linux distros include anacron or systemd timers. The former is older and more cron-like, while the latter has newer features but isn't universally used.

Or, you could implement a HA system. Do rolling upgrades by moving processing to a different node in the load balancer or cluster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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