Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
24
rated 0 times [  24] [ 0]  / answers: 1 / hits: 22382  / 1 Year ago, mon, may 29, 2023, 4:44:32

I'm trying to download a large 2GB file with wget, but after a few minutes it seems to keep stalling.



I ^C it, and wget it again [with --continue option], and it starts downloading again.



Is there a way to automate retrying the download when it stops downloading? Thanks


More From » wget

 Answers
0

You could use the --tries option.



   --tries=number
Set number of retries 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.


So --tries=0 should do the trick.



That, combined with --read-timeout=seconds too. The seconds refers to idle time: if, at any point in the download, no data is received for more than the specified number of seconds, reading fails and the download is restarted.



So the final command:



wget -c --tries=0 --read-timeout=20 [URL]


[#42525] Tuesday, May 30, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ranquctive

Total Points: 391
Total Questions: 103
Total Answers: 104

Location: South Sudan
Member since Thu, Feb 4, 2021
3 Years ago
ranquctive questions
;