Seems like such a simple question, but I can't find an answer to:

Cron is scheduled to run daily, say at midnight. If my system is offline during that period of time and I turn it on the next day, cron won't run my jobs on boot. Is there any way to change this behaviour, say by making all backlogged jobs run at once on boot?


Not with vixiecron, not exactly.

You probably want anacron, which was specifically created to cover the "offline" gap in cron. Anacron is designed to work with cron, but you could use a complete cron replacement instead. FCron is one which will take system down time in to account.

  • Thanks, I'm currently using dcron, but this is probably what I need. – david Sep 29 '10 at 16:24
  • This is the right way to do it. – Matt Joiner Sep 29 '10 at 22:47

You might need to add a separate entry:

@reboot /path/to/job

  • Is it possible to run once on reboot, but only a maximum of once a day? Thanks – david Sep 29 '10 at 16:09
  • I suggest you do a verification on the script that will check if the script has already been executed for the day. For this, all I can think of is using the date command and check it against a file wherein another date is written. It will be the same file which the script will overwrite the current value if date is not the same (after execution) – Ruel Sep 29 '10 at 16:17

I'd say that in a robust system, run the cron jobs more often than you really want, and have them check if they need to do any work, and only do it if necessary.

THis is often a good idea anyway, as a previous run may have failed.


I suppose you need this. Apparently, you can schedule jobs to run only once a day using /etc/cron.daily.

Your Answer

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