Prevent `wget` hanging when it encounters error 500

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I am downloading a couple of thousand files listed in a file using:
wget -i filename
Sometimes it encounters the following error reported by the server for a particular file:
HTTP request sent, awaiting response... 500 Internal Server Error
The problem is that wget then hangs. What I want for it to skip that file and continue downloading the rest of the list. How can I do that?
command-line wget
add a comment |Â
up vote
1
down vote
favorite
I am downloading a couple of thousand files listed in a file using:
wget -i filename
Sometimes it encounters the following error reported by the server for a particular file:
HTTP request sent, awaiting response... 500 Internal Server Error
The problem is that wget then hangs. What I want for it to skip that file and continue downloading the rest of the list. How can I do that?
command-line wget
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am downloading a couple of thousand files listed in a file using:
wget -i filename
Sometimes it encounters the following error reported by the server for a particular file:
HTTP request sent, awaiting response... 500 Internal Server Error
The problem is that wget then hangs. What I want for it to skip that file and continue downloading the rest of the list. How can I do that?
command-line wget
I am downloading a couple of thousand files listed in a file using:
wget -i filename
Sometimes it encounters the following error reported by the server for a particular file:
HTTP request sent, awaiting response... 500 Internal Server Error
The problem is that wget then hangs. What I want for it to skip that file and continue downloading the rest of the list. How can I do that?
command-line wget
command-line wget
asked Oct 3 '17 at 20:38
JBentley
1086
1086
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
Try using wget --tries=1 --waitretry=1 -i filename. This will try only once after a failure and only wait one second before doing so. It's also possible the server is not closing the socket after sending the 500 error. In this case, adding --read-timeout=30 will timeout the connection after 30 seconds of no data from the server. See the manual
1
--tries=0will retry indefinitely. The server may be intentionally leaving the connection open - try setting--read-timeout=15
â Outurnate
Oct 3 '17 at 20:52
@JBentley On it
â Outurnate
Oct 3 '17 at 23:54
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Try using wget --tries=1 --waitretry=1 -i filename. This will try only once after a failure and only wait one second before doing so. It's also possible the server is not closing the socket after sending the 500 error. In this case, adding --read-timeout=30 will timeout the connection after 30 seconds of no data from the server. See the manual
1
--tries=0will retry indefinitely. The server may be intentionally leaving the connection open - try setting--read-timeout=15
â Outurnate
Oct 3 '17 at 20:52
@JBentley On it
â Outurnate
Oct 3 '17 at 23:54
add a comment |Â
up vote
3
down vote
accepted
Try using wget --tries=1 --waitretry=1 -i filename. This will try only once after a failure and only wait one second before doing so. It's also possible the server is not closing the socket after sending the 500 error. In this case, adding --read-timeout=30 will timeout the connection after 30 seconds of no data from the server. See the manual
1
--tries=0will retry indefinitely. The server may be intentionally leaving the connection open - try setting--read-timeout=15
â Outurnate
Oct 3 '17 at 20:52
@JBentley On it
â Outurnate
Oct 3 '17 at 23:54
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Try using wget --tries=1 --waitretry=1 -i filename. This will try only once after a failure and only wait one second before doing so. It's also possible the server is not closing the socket after sending the 500 error. In this case, adding --read-timeout=30 will timeout the connection after 30 seconds of no data from the server. See the manual
Try using wget --tries=1 --waitretry=1 -i filename. This will try only once after a failure and only wait one second before doing so. It's also possible the server is not closing the socket after sending the 500 error. In this case, adding --read-timeout=30 will timeout the connection after 30 seconds of no data from the server. See the manual
edited Oct 3 '17 at 23:56
answered Oct 3 '17 at 20:43
Outurnate
914416
914416
1
--tries=0will retry indefinitely. The server may be intentionally leaving the connection open - try setting--read-timeout=15
â Outurnate
Oct 3 '17 at 20:52
@JBentley On it
â Outurnate
Oct 3 '17 at 23:54
add a comment |Â
1
--tries=0will retry indefinitely. The server may be intentionally leaving the connection open - try setting--read-timeout=15
â Outurnate
Oct 3 '17 at 20:52
@JBentley On it
â Outurnate
Oct 3 '17 at 23:54
1
1
--tries=0 will retry indefinitely. The server may be intentionally leaving the connection open - try setting --read-timeout=15â Outurnate
Oct 3 '17 at 20:52
--tries=0 will retry indefinitely. The server may be intentionally leaving the connection open - try setting --read-timeout=15â Outurnate
Oct 3 '17 at 20:52
@JBentley On it
â Outurnate
Oct 3 '17 at 23:54
@JBentley On it
â Outurnate
Oct 3 '17 at 23:54
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395917%2fprevent-wget-hanging-when-it-encounters-error-500%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password