2

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.

user2543853
  • 19
  • 1
  • 2

2 Answers2

0

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
  • 6,222
  • 3
  • 23
  • 41
  • The goal is as I stated in the second paragraph, for it to hit the url every 5 minutes. It will run every 5 minutes, but it will time out doing so. Also, I'm fairly confident that it's not working as intended. It tells me that it times out attempting to reach the server, is this not indicative of failure? – user2543853 Apr 14 '14 at 18:33
  • What happens if you run the same command from the command line ? I posit your problem is not with cron or wget, rather with your web server. If attempting to access it from the command line fails, what happens if you do a manual request by telnetting on port 80 ? Lastly, is the machine behind any kind of NAT ? – davidgo Apr 14 '14 at 19:01
  • Same thing. "failed: Connection timed out. Giving up." Those answers I don't have, as the physical box belongs to the client and I have no direct access to it beyond what what meager tools webmin provides me. I did the same command, but pointed it to Google, and it worked immediately. – user2543853 Apr 14 '14 at 20:08
-2

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
  • 19
  • 1
  • 2