在 wget 下载之间等待
Wait between wget downloads
我正在尝试从网站下载目录(包括子目录)。
我正在使用:
wget -r -e robots=off --no-parent --reject "index.html*" http://example.com/directory1/
问题是,服务器稍后拒绝连接,我认为短时间内连接太多。所以我想做的是在每个 download/lookup 之间插入一个等待时间(5 秒)。那可能吗?如果可以,怎么做?
您可以使用 --wait
。来自 wget(1)
:
-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.
我也不知道,但我使用 wget
联机帮助页在 15 秒内找到了这个答案:
- 输入
man wget
.
- 可以用
/
来搜索,所以我用了/wait
。
- 这是第一击!
- 按
q
退出。
我正在尝试从网站下载目录(包括子目录)。 我正在使用:
wget -r -e robots=off --no-parent --reject "index.html*" http://example.com/directory1/
问题是,服务器稍后拒绝连接,我认为短时间内连接太多。所以我想做的是在每个 download/lookup 之间插入一个等待时间(5 秒)。那可能吗?如果可以,怎么做?
您可以使用 --wait
。来自 wget(1)
:
-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.
我也不知道,但我使用 wget
联机帮助页在 15 秒内找到了这个答案:
- 输入
man wget
. - 可以用
/
来搜索,所以我用了/wait
。 - 这是第一击!
- 按
q
退出。