How to config wget to retry more than 20?

jon doe picture jon doe · Jul 11, 2015 · Viewed 20.1k times · Source

I used d4x to continue download, but it's obsolete from ubuntu. So I use flashgot with wget to continue download. But wget stops after 20 tries, I have to restart manually. Is there any conf file I could modify the retry times more than 20?

The wget CLI is automatic created by wget, so please don't tell me I could make options with the wget CLI.

Answer

Filip Bulovic picture Filip Bulovic · Jul 11, 2015

Use the --tries option:

wget --tries=42 http://example.org/

Specify --tries=0 or --tries=inf for infinite retrying (default is 20 retries).

The default value also can be changed via config file, if that is your thing; open /etc/wgetrc and look there for:

# You can lower (or raise) the default number of retries when
# downloading a file (default is 20).
#tries = 20

uncomment tries=20 and change it to what you want.

The default is to retry 20 times, with the exception of fatal errors like "connection refused" or "not found" (404), which are not retried