What happens to a Cronjob of 2:30 if the server falls at 2:28 and only come back 5 minutes later?

14

I do not know if the question is confusing, but it's that I've used a lot of Cronjob on my systems these days and I do not want to have problems. So I'll illustrate my concern with a hypothetical situation.

Let's say I have a Cronjob programmed to run 2:30 in the morning. However, the server provider needed to be upgraded (or gave some internal trouble) and shut down the server as%% of the morning. But 5 minutes later, that is, 2:28 , the service has been restored.

What will happen with that 2:32 schedule? Will it run when the machine starts? Or will it be completely ignored, running just the other day?

I need to know this, because I have some scripts that have specific dates or times to run, and I do not want to have damage with information and events from my systems.

If the answer is yes for "will be ignored?", how can I check to see if the server has been restarted and if a cron has not run at a certain time and then run? p>     

asked by anonymous 02.05.2016 / 22:00

1 answer

11

Simple, it will not run because Cronjob ignores a service that passed the time and system was not working and will only run on another day normally (if it does not occur the same situation).

On Linux, users use Crontab , but for better performance of the scheduled system it is also good to use a program called Anacron .

Anacron is a program that helps you schedule specific intervals on the day, so along with Cron you can make these scheduling errors no longer, as Cron assumes that the system works 24 hours a day.

To know how to use Cron with Anacron I suggest you read this article that explains how to use:

link

And for more information on Anacron please visit:

link

To monitor the shutdown time of a Linux Server:

link

To find out if your Cron is running normally:

link

    
22.05.2016 / 04:39