PHP user here. I'm using an endless loop to perform to mimic a cron. The script does something every 20 minutes. It sleep()s in the meantime.
I have various checks that ensure that only instance can run, including a "gentleman agreement" locked file.
However, I'd like to make sure that only one instance of the cron script is running. It would also be useful for me to be a 100% certain that the cron script is actually running when it tells me it is.
Can it be done? If yes, how? I have unfortunately no experience in this area.
I'm very new to this, so please excuse a fire of questions.
I hadn't thought about a log file. But it makes sense. However, since the script executes itself every 30 seconds, 8 hours a day, 5 days a week, I guess I would only log failures (if not, I would end up with a huge log file). What would be your approach?
The tail command reads and print the final lines of an input. So I would basically read the log file, correct?
Very interesting, even though it will take some serious time for a command newbie like me to translate it into an understandable sentence