If the default retry value can not meet your needs, it seems you are downloading from an unstable source.
The following option may also help a lot.
--retry-connrefused --read-timeout=20 --timeout=15 --tries=0 --continue
--retry-connrefused
Force wget to retry even the server refuses requests, otherwise wget will stop to retry.
--waitretry=1
If you decide to retry many times, it's better to add some short period between each retry.
--timeout=15
unstable link always cause stopping of data flow, the default 900s timeout is too long. There is --dns-timeout
, --connect-timeout
, and --read-timeout
. By specify --timeout
, you update them all at the same time.
--tries=0
Make wget to retry infinity except fatal situations such as 404.
--continue
resume download
2023-02-28T17:59:32 added
Recently, I found wget will auto exist after severl tries on a very unstable link, with all the options above configured.
So, I come up with a autohotkey script, which will check if wget is still running. If not, it will bring up it again.
; AutoHotkey Version: 1.x
; Language: English
; Platform: WinXP/7
; Author: studotwho
; Url: https://www.autohotkey.com/board/topic/66615-continuously-check-if-a-program-is-running-and-start-it/
;
; Script Function:
; Restarts the iTeleportConnect service if it hasn't started - this usually happens if your
; wireless network interface hasn't started when iTC tries to connect.
;
; This script loops every (45) seconds to determine if iTC is running or not, and restarts it if it's not.
;
#SingleInstance, force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
iTC_EXE = C:\usrprogs\wget-1.19.4-win32\lowspeeddown.bat
iTC_Path = C:\usrprogs\wget-1.19.4-win32
iTC_imgName = wget.exe
loop {
sleep 3000
Process, Exist, %iTC_imgName% ; check to see if iTeleportConnect is running
If (ErrorLevel = 0) ; If it is not running
{
Run, %iTC_EXE%, %iTC_Path%
}
Else ; If it is running, ErrorLevel equals the process id for the target program (Printkey). Then do nothing.
{
sleep 5
}
}
2024-02-16T18:47:08
Sorry, I just noticed that the question is about running wget binary by flashgot on a ubuntu system.