等待两次wget下载 [英] Wait between wget downloads

查看:76
本文介绍了等待两次wget下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从网站下载目录(包括子目录).我正在使用:

I'm trying to download a directory (incl subs) from a website. I'm using:

wget -r -e robots=off --no-parent --reject "index.html*" http://example.com/directory1/

问题是,服务器稍后拒绝连接,我认为在短时间内连接太多.所以我想做的是在每次下载/查找之间插入一个等待时间(5秒).那可能吗?如果可以,怎么办?

Problem is, the server refuses connection after a bit, I think there's too many connections within a short amount of time. So what I'd like to do is insert a wait time (5 seconds) between each download/lookup. Is that possible? If so, how?

推荐答案

您可以使用-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秒内找到了这个答案:

I didn't know this either, but I found this answer in 15 seconds by using the wget manpage:

  • 输入 man wget .
  • 您可以使用/进行搜索,所以我使用了/wait .
  • 这是第一弹!
  • q 退出.
  • Type man wget.
  • You can use / to search, so I used /wait.
  • It's the first hit!
  • Press q to quit.

这篇关于等待两次wget下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆