Wget,失败或超时后中止重试


11

我用wget调用网址:

/usr/bin/wget --read-timeout=7200 https://site_url/s

在这种情况下,尽管设置了超时,但Wget每15分钟执行一次GET请求,为什么会发生这种情况?

该呼叫只能进行一次,如何将wget设置为NOT Retry?
我知道您可以设置,t=n但0是无限的,而1比我想要的多1。

Answers:


16

再次阅读手册页:

   -t number
   --tries=number
       Set number of tries to number. Specify 0 or inf for infinite
       retrying.  The default is to retry 20 times, with the exception
       of fatal errors like "connection refused" or "not found" (404),
       which are not retried.

使用-t定义尝试(尝试),而不是重试次数。


1
谢谢,不确定为什么配置0应该等于无限次重试,但是谢谢!
蓝天

@ blue-sky,因为它不是“重试”,而是“重试”。因此,0毫无意义(根本不执行)。在这种情况下,0最适合“无限”,这就是采用它的方式。
Choinek
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.