E
E
Evgeny Ivanov2017-11-20 12:11:16
linux
Evgeny Ivanov, 2017-11-20 12:11:16

Why isn't the cron job running?

Scripts collect information and enter it into the database. If you run the scripts from the browser, then everything works.
New rows appear in the database tables.
I need to collect information every 30 minutes. So I created a cron job.

*/30 * * * * /usr/bin/php5  /var/www/4/get_data_from_site/get_data_from_site1.php >/dev/null 2>&1
*/30 * * * * /usr/bin/php5  /var/www/4/get_data_from_site/get_data_from_site2.php >/dev/null 2>&1

Restarted cron.
But 2 hours have passed, and there are no new rows in the database tables. Those. the task is not running.
Why isn't the cron job running?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Popov, 2017-11-20
@DenisDangerous

can be called as a site. run curl on the crone ... it will be even more convenient this way ...

A
Andrey Mikhalev, 2017-11-20
@Endru9

what user is the script running as?
redirect the output to a file (not to /dev/null) and see what's swearing

V
vanoc, 2017-11-20
@Zoro

I would first check if the service is running at all :-)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question