I have a problem with crond (dated 13Feb21) on my Slackware 14.2 x86_64 (Linux version 5.12.10) server.
I have a script that crond runs every minute that accesses an external device for current data and logs it to a file. I will call the script Script1, and it runs fine.
I also have anther script that runs every minute and it processes a file that is larger in size each time the script runs. As result the script takes longer to run each time as well. This script also runs fine, and I will call it Script2. The two scripts are not related and there are no files shared between the two scripts.
Recently I noted Script1 was only logging the data to the data file every other minute instead of every minute. I finally traced the problem and I am not sure if is a real solvable problem, or a misconception on my part on how crond works.
When the file being processed by Script2 becomes large enough, the script takes more than a minute to run. Using “crond –l debug” to monitor what crond was doing, it appears that if Script2 is still running at the beginning of the next minute, it does not start Script1, so no data is logged. Even stranger however, is that there are several other scripts that should run every minute and they do not start as well.
I was under the impression that crond looked at what is scheduled to run at the present moment in time and disregarded any past scheduled tasks. What appears to be happening now is that if a script is still running at the next minute, it does not do anything for that whole next minute. When crond is running in debug mode, the cron log shows absolutely no activity for the entire subsequent minute. It is only at the next following minute when Script2 is no longer running, that crond activity returns to normal.
Can someone enlighten me as to what is going on?
Thanks