Cron jobs when system offline

Posted on

Cron jobs when system offline – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, cron, , , .

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?

Solution :

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.

You might need to add a separate entry:

@reboot /path/to/job

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.

Leave a Reply

Your email address will not be published.