2016-03-25 6 views
1

ウェブサイトからディレクトリをダウンロードしようとしています。 私が使用している:wgetのダウンロードを待つ

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

問題は、サーバーが少し後に接続を拒否し、私は短い時間内にあまりにも多くの接続があると思います。だから私がしたいのは、各ダウンロード/参照の間に待機時間(5秒)を挿入することです。それは可能ですか?もしそうなら、どうですか?

答えて

2

--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 manページを使って、15秒でこの答えを見つけました:

  • タイプman wgetを。
  • /を使用すると検索できるので、/waitを使用しました。
  • 初めてのヒットです!
  • qを押すと終了します。
関連する問題