14
I don’t know if the question is confusing, but is that I have used a lot of Cronjob in my systems currently and do not want to have problems. So I’m going to illustrate my concern with a hypothetical situation.
Suppose I have a Cronjob programmed to run 2:30
morning. However, the server provider had to go into maintenance (or gave some internal problem) and shut down the server 2:28
morning. But 5 minutes later, ie, 2:32
, the service was restored.
What will happen to that schedule of 2:30
?
Will it run when the machine starts? Or it will be completely ignored, running only the other day?
I need to know this because I have some scripts that have specific dates or times to run, and I don’t want to have harm with information and events from my systems.
If the answer is yes to "will be ignored?" , how can I check if the server was restarted and if a cron was not executed at a certain time and then run?
A doubt I’ve always had. + 1, it’s also something I’d like to know on Windows-Server, if there is any situation in the task scheduler.
– Guilherme Nascimento
Yes is possible also for Windows Server, the equivalent of Cronjob would be the Task Scheduler. For more information check this link : https://en.wikipedia.org/wiki/Windows_Task_Scheduler
– Falion
@Falion I think you misunderstood me, I want to know if the problem can occur in Windowsserver, if he performs the task even if the time has passed, for example the machine was off 30 minutes and in that time had a task =) basically the same question of Wallace, but in windowsserver, thank you
– Guilherme Nascimento
@Guilhermenascimento So, the equivalent of the Windows Server is the Task Scheduler and it as well as others follows the same pattern as the Linux Cron, if the machine is turned off for example 30 minutes and at that time had a task,He takes it as a principle that the system goes on 24 hours without stopping. This is why it is recommended to use services other than Cronjob to avoid errors like this.
– Falion
What language are you working on? If it’s something web, can you show me how to do it on this side ;)
– Fábio
@Fábio yes sir, I work with Web. PHP :)
– Wallace Maxters