LINUX.ORG.RU

настроить wget на определенное время скачивания файла

 


1

1

Сейчас у меня wget настроен на скачивание файлов по списку, однако, иногда из-за плохой связи 3g, файл может «застрять» на середине и очень долгое время стопорить дальнейшую очередь не скачиваясь сам.

Можно ли как-нибудь настроить wget чтобы он пробовал скачивать файл только определенное время(например, 2 минуты), а если после этого файл так и не скачан, переходил к следующему?


man wget и там timeout

Deleted
()
-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 to 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.
xtraeft ★★☆☆
()
Последнее исправление: xtraeft (всего исправлений: 1)

wget -T seconds и проверять $? чтобы вернуть файлик в конец списка и попытаться скачать его еще раз позднее

Frakhtan-teh ★★
()

man timeout

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.