Aus 'man wget':
-t number
--tries=number
Set number of retries to number. Specify 0 or inf for infinite retrying. The default is to retry 20 times, with the exception of fatal errors like ''connection refused'' or ''not found'' (404), which are not retried.
-T seconds
--timeout=seconds
Set the network timeout to seconds seconds. This is equivalent to specifying --dns-timeout, --connect-timeout, and --read-timeout, all at the same time.
When interacting with the network, Wget can check for timeout and abort the operation if it takes too long. This prevents anomalies like hanging reads and infinite connects. The only timeout enabled by default is a 900-second read timeout. Setting a timeout to 0 disables it altogether. Unless you know what you are doing, it is best not to change the default timeout settings.
All timeout-related options accept decimal values, as well as subsecond values. For example, 0.1 seconds is a legal (though unwise) choice of timeout. Subsecond timeouts are useful for checking server response times or for testing network latency.
--dns-timeout=seconds
Set the DNS lookup timeout to seconds seconds. DNS lookups that don't complete within the specified time will fail. By default, there is no timeout on DNS lookups, other than that implemented by system libraries.
--connect-timeout=seconds
Set the connect timeout to seconds seconds. TCP connections that take longer to establish will be aborted. By default, there is no connect timeout, other than that implemented by system libraries.
--read-timeout=seconds
Set the read (and write) timeout to seconds seconds. The ''time'' of this timeout refers idle time: if, at any point in the download, no data is received for more than the specified number of seconds, reading fails and the download is restarted. This option does not directly affect the duration of the entire download.
Of course, the remote server may choose to terminate the connection sooner than this option requires. The default read timeout is 900 seconds.
900 Sekunden stehen da im Raum.
-w seconds
--wait=seconds
Wait the specified number of seconds between the retrievals. Use of this option is recommended, as it lightens the server load by making the requests less frequent. Instead of in seconds, the time can be specified in minutes using the "m" suffix, in hours using "h" suffix, or in days using "d" suffix.
Specifying a large value for this option is useful if the network or the destination host is down, so that Wget can wait long enough to reasonably expect the network error to be fixed before the retry. The waiting interval specified by this function is influenced by "--random-wait", which see.
--waitretry=seconds
If you don't want Wget to wait between every retrieval, but only between retries of failed downloads, you can use this option. Wget will use linear backoff, waiting 1 second after the first failure on a given file, then waiting 2 seconds after the second failure on that file, up to the maximum number of seconds you specify. Therefore, a value of 10 will actually make Wget wait up to (1 + 2 + ... + 10) = 55 seconds per file.
Note that this option is turned on by default in the global wgetrc file.
--random-wait
Some web sites may perform log analysis to identify retrieval programs such as Wget by looking for statistically significant similarities in the time between requests. This option causes the time between requests to vary between 0.5 and 1.5 * wait seconds, where wait was specified using the --wait option, in order to mask Wget's presence from such analysis.
A 2001 article in a publication devoted to development on a popular consumer platform provided code to perform this analysis on the fly. Its author suggested blocking at the class C address level to ensure automated retrieval programs were blocked despite changing DHCP-supplied addresses.
The --random-wait option was inspired by this ill-advised recommendation to block many unrelated users from a web site due to the actions of one.
In der Art:
Code: Alles auswählen
[/Pfad/]wget --tries=2 --timeout=2 --wait=2 [--quiet|--no-verbose].......
Ein fehlgeschlagener Versuch wäre dann nach ~ 10sec beendet.
--------------------------------
* * * * 1,4 WGETTER.sh BLAPAGE
WGETTER.sh müßte Pfad-erreichbar sein, vielleicht in /usr/local/bin ?
Wenn cron das nicht mitmacht, dann einfach mit Pfad angeben:
$1 ist der erste übergebene Parameter, in diesem Fall "BLAPAGE",
die Ersetzung 'THIS="$1"' mache ich, da ich nicht weiß wie "BLAPAGE" letztendlich aussieht und ich es daher quoten wollte,
und aus Unsicherheit sollte ein Konstrukt
"http://...../'$1'...." oder
"http://...../${1}..." vermieden werden.
(In testing-squeeze wurde kürzlich die POSIX-legere bash-sh durch die POSIX-strenge dash ersetzt
und dadurch fand ich einige POSIX-inkompatible Angewohnheiten in meinen (bash-)sh-Skripten)