# Ubuntu – how to make wget retry download if speed goes below certain threshold

wget

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.

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

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.
wget -c --tries=0 --read-timeout=20 [URL]