Sometimes wget just hangs in the middle of a download:
50% [===================> ] 500,000 500KB/s eta 5m 5s
I just end up doing a
wget --continue to restart it, and it seems to work for a while til it hangs again.
Wondering (a) if there is a way for it to throw an error in this case, or (b) to automatically restart (maybe with some external wrapping script).
Also if you happen to know a general reason why this might happen or what's happening, that would be interesting to know, but not necessary. Mainly just want to know how to get it to restart (or at least throw an error).
BTW by "hang" I mean it just sits there, nothing changes in the terminal, etc. But it doesn't seem to be causing a memory leak or causing my computer's CPU to be overtaken so it's humming and there's no CPU left. Instead it just sits there and I have to restart it.
I have tried this as well but it doesn't do anything:
wget --continue --tries=0 --read-timeout=10 http://domain.com/foo/bar.zip
Also, I can still be running multiple other wgets at the same time on unrelated domains in different terminal windows, so perhaps it is the domain that is never responding or something. Not sure what to do.