Mystery - Real Brain Teaser - I am Totally stumped !
OMV5 in Pi4 2gb
nginx in Docker
local php script running on Nginx
I have a php script that is run every 20 minutes.
The php script logs an entry in a .log file ( on the external USB HD connected to the Pi ) , using php code :
$extData = fopen($cronLogFile, "a"); fwrite($extData,date("y-m-d H:i:s")." --- process started" . $LE); // log entry with current server date and time fclose($extData);
In addition, the OMV > System > Scheduled Jobs has the Cron task, and 'Send Command output via email' is enabled.
The Scheduled Job command is :
Early hours we were having a scheduled power outage - 00h00 to 02h00.
So we turned off the fiber & network routers, and UPS ( battery dying ) 10 minutes before the power goes off.
Power does go off, which means no power to the Pi from 00h00 to 02h00. This I am 100% certain of.
The network router and fiber routers were off until we got up and turned them on at 05h30
The log file, created by the php script on the HD, has logs that say the code ran at the 20 minute intervals :
21-10-27 00:00:01 --- process started 21-10-27 00:20:02 --- process started 21-10-27 00:40:02 --- process started 21-10-27 01:00:01 --- process started 21-10-27 01:20:02 --- process started 21-10-27 01:40:01 --- process started 21-10-27 02:00:02 --- process started 21-10-27 02:20:01 --- process started 21-10-27 02:40:02 --- process started 21-10-27 03:00:02 --- process started 21-10-27 06:00:02 --- process started 21-10-27 06:20:01 --- process started
I also got emails from the Scheduled Jobs ('Send Command output via email') with the same times.
emails all arrived after the power to the network and fibre routers was restored at 05h30
So 2 mysteries here :
Does Cron ( Scheduled Jobs ) run multiple times after power is restored ?
Power was certainly off until 02h00, but it appears to have run at the 20 minute intervals.
Why would the 'Scheduled Jobs' NOT run from after 03h00, missing a 3 hour block - would there be some sort of buffer that was full caused by the 10 notifications ( from 00h00 to 03h00 ) that were waiting for internet connection to send out the notifications ?