2016-03-25 30 views
1

Bir web sitesinden bir dizini (dahil olmak üzere) indirmeye çalışıyorum. kullanıyorum:Wget yüklemeleri arasında bekleyin

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

Sorun, sunucu biraz sonra bağlantıyı reddediyor, ben kısa bir miktar içinde çok fazla bağlantısı var. Yani yapmak istediğim, her indirme/arama arasında bir bekleme süresi (5 saniye) eklemektir. Mümkün mü? Öyleyse nasıl?

cevap

2

--wait'u kullanabilirsiniz. wget(1) Gönderen:

-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. 

Bunu bende bilmiyordum ama wget manpage kullanarak 15 saniye içinde bu cevabı bulundu:

  • Tipi man wget.
  • /'u aramak için /wait kullandım.
  • İlk vuruş!
  • Çıkmak için q tuşlarına basın.