Downloading a file over an unstable connection with wget
I’m currently downloading a very big file (15GB) over a slow and unstable connection, so I was looking for a way to resume the download if the connection stalled or if I had to disconnect my notebook for a while.
I ended up using good old wget with the following options:
wget -c --tries=0 --retry-connrefused --timeout=2 --wait=1 \ http://www.schmidp.com/bigfile
-c tells wget to continue a download, so you can stop wget and restart it later without downloading the whole file again.
–tries=0 means that the download will be tried indefinitely if the connection breaks.
–retry-connrefused forces wget to retry even if the server is currently not listening.
–timeout=2 tells wget to reconnect if no data is received for more than 2 seconds.
–wait=1 means wget will sleep for one second before it reconnects.
comments powered by Disqus