Cron getting timeout when attempting to access url (wget).

by user2543853   Last Updated August 26, 2018 13:00 PM - source

I'm sure this is simple and I've been digging but no answer is quite as specific as I need it to be.

The goal is easy, have Cron hit a url on my server every 5 minutes. All of that is set up and functions fine, the issue is that it times out when accessing it. Anyone with a browser can, at the moment, reach it however.

Per usual, the devil is in the details. It is an ExpressionEngine site and, therefore, is PHP. Does this mess with Cron?

There is also the .htaccess file performing rewrites to make the URL less verbose, does this interfere with Cron?

This isn't the exact link I need, but its safe enough to post to give an idea.

'site' is the template group name within EE. This is hitting its index page. For right now its just an IP with no name to resolve to (this is beyond my control, in someone else's hands).

The Cron script I wrote doesn't do anything fancy, nor does it need to, and simply has to hit off every 5 minutes.

Here is what I have at the moment:

wget -O - -t 5

^This was set up via Webmin Cron Scheduler module.

Tags : php cron url wget

Answers 2

Its unclear what you are asking, but neither the Expression Engine or PHP url's interfere with Cron. WGET simply acts as a command line webclient and the same parsing (by the web server and php) is done on the URL as if you had accessed it from a webbrowser on the machine.

If in doubt, you may be able to temporarily modify the cron entry by modifying the cron entry to something like

wget -O - -t 5  >> /tmp/wget-result.html

And then checking the log file to make sure its working as intended.

April 14, 2014 18:19 PM

Cron couldn't get to the server itself thanks to some DNS issues, so the IP I gave it didn't do anything. It's now functioning without so much as a hiccup.

May 29, 2014 18:13 PM

Related Questions

Why is only one wget command working in my crontab?

Updated March 27, 2019 14:00 PM

How to increase wget timeout wait

Updated February 15, 2018 15:00 PM

APT FATAL -> Failed to fork

Updated June 13, 2015 22:00 PM