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

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

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.

http://204.15.99.54/site

'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 http://204.15.99.54/site

^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 http://204.15.99.54/site  >> /tmp/wget-result.html

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

davidgo
davidgo
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.

user2543853
user2543853
May 29, 2014 18:13 PM

Related Questions


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


Why is wget failing on this Url?

Updated May 14, 2015 12:00 PM