Never Ending Security

It starts all here

Wget – automatically resume broken downloads

Wget is a commandline utility to download files over the http protocols. To download a file for example the syntax would be

$ wget

The above command will start downloading the file and save it in the home directory of the user. However if the download breaks, due to poor internet for example then wget will stop the download. Now this could be irritating for large downloads when you need to check if the downloading is going on fine.

When the internet is flaky, what happens is that wget tries to connect and when it cant, it thinks that the server is down or does not exist anymore. Therefore we need to tell wget even if the connection is refused.

Here is the simple command

$ wget -c --retry-connrefused --tries=0 --timeout=5

The retry-connrefused option tells wget to reconnect even if the earlier connection attempt had failed, so effectively wget will keep connecting everytime the internet goes down and comes up again. This makes automatic download of large files more reliable.

The tries=0 option tells wget to keep trying infinitely.

However even this technique has limitations, for example if the connection exists but data transfer fails, then wget will think that no data is being served and would quit.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s