wget connection timed out on same server

只愿长相守 提交于 2020-01-25 22:00:11

问题


I've got a very strange problem.

There's a cron job on the server to run a script daily:

wget -O /dev/null --timeout=300 --tries=1 "http://website.com/script"

It was all working well since about two weeks ago, I started receiving errors:

--2016-07-13 09:45:01--  http://website.com/script
Resolving website.com (website.com)... 11.22.33.44
Connecting to website.com (website.com)|11.22.33.44|:80... failed: Connection timed out.
Giving up.

These are some information for this question:

  1. The cron job is on the same server of http://website.com hosted.
  2. I can access the script (http://website.com/script) correctly from browser on my desktop.
  3. The server is CentOS 7, with WHM and cPanel installed.

Anyone know what could be the issue? or how do I suppose to identify the issue?

Thanks


回答1:


If the website is up try a different command.

*/10 * * * * /usr/bin/wget -q -O temp.txt http://website.com/script




回答2:


Try adding -H

wget -H -O /dev/null --timeout=300 --tries=1 "http://website.com/script"


来源:https://stackoverflow.com/questions/38428635/wget-connection-timed-out-on-same-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!