我正在使用Wget通过cron运行一个PHP脚本,命令如下:
wget -O - -q -t 1 http://www.example.com/cron/run
脚本处理最多需要5-6分钟.WGet会等待它并给予它所需的所有时间,还是会暂停?
我正在使用Wget通过cron运行一个PHP脚本,命令如下:
wget -O - -q -t 1 http://www.example.com/cron/run
脚本处理最多需要5-6分钟.WGet会等待它并给予它所需的所有时间,还是会暂停?
根据the man page of wget,有几个选项与超时有关——默认读取超时为900秒——所以我说,是的,它可能超时.
-T seconds
--timeout=seconds
将网络超时设置为秒
--dns-timeout=seconds
将DNS查找超时设置为秒
--connect-timeout=seconds
将连接超时设置为秒
--read-timeout=seconds
将读取(和写入)超时设置为
wget -O - -q -t 1 --timeout=600 http://www.example.com/cron/run
应该确保在超过脚本持续时间之前没有超时.
(Yeah, that's probably the most brutal solution possible ^^ )