A
A
aopil2019-05-11 15:33:43
Task Schedulers
aopil, 2019-05-11 15:33:43

Why does Cron NOT work consistently?

It is very important for me to run CRON every minute, I issue the following command:

/usr/bin/wget -O - -q -t 1 http://www.123.com/script/start.php

It works, but I decided to record the time in a file so that I can clearly see when CRON starts and this is what I get:
2019-05-11 11:44:02
2019-05-11 11:46:03
2019-05-11 11:47:02
2019-05-11 11:48:01
2019-05-11 11:49:02
2019-05-11 11:50:02
2019-05-11 11:51:02
2019-05-11 11:52:01
2019-05-11 11:53:02
2019-05-11 11:54:02
2019-05-11 11:55:02 ******
2019-05-11 11:57:02 ******
2019-05-11 11:58:03
2019-05-11 11:59:01
2019-05-11 12:01:02 ******
2019-05-11 12:03:02 ******
2019-05-11 12:04:02 ******
2019-05-11 12:06:03 ******
2019-05-11 12:07:02
2019-05-11 12:08:02
2019-05-11 12:09:02
2019-05-11 12:10:04 ******
2019-05-11 12:12:03 ******
2019-05-11 12:13:02
2019-05-11 12:14:03 ******
2019-05-11 12:16:03 ******
2019-05-11 12:17:02 ******
2019-05-11 12:19:02 ******
2019-05-11 12:20:02

I highlighted * moments where the script does not run (skip 1st minute) sometimes it skips 2-3 minutes.
There is nothing in the Error log except for the error Could not execute scriptthat I discussed here
The hoster refers to a mysql error, they say crons do not close the connection to the database, but in fact I did it, and now the connection is closed, but the error has not disappeared. (Mysql errors I write to a file - they are not there).
It turns out that the whole problem is that with some calls we get an error and Cron does not start? Or maybe I specified the command incorrectly somehow?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hint000, 2019-05-12
@hint000

This is not a cron issue.

I decided to record the time in a file
is a good debugging technique, but: are you making this entry from your start.php?
Then you're missing the case that wget ran but start.php didn't. This is probably your case. Keep debugging, make wget log.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question