2013-05-05 88 views
1

wget的遞歸選項(-r選項)偶爾會生成許多文件。例如,wget -r www.cnn.com給出如下:遞歸wget控件下載

--2013-05-05 10:35:54-- http://www.cnn.com/about/ 
Reusing existing connection to www.cnn.com:80. 
HTTP request sent, awaiting response... 200 OK 
Length: unspecified [text/html] 
Saving to: ‘www.cnn.com/about/index.html’ 

--2013-05-05 10:35:54-- http://www.cnn.com/help/ 
Reusing existing connection to www.cnn.com:80. 
HTTP request sent, awaiting response... 200 OK 
Length: unspecified [text/html] 
Saving to: ‘www.cnn.com/help/index.html’ 

...... 

怎麼可以這樣控制 - 我們可以指定下載的最大總大小,下載的最大時間等?

回答

1

要在一段時間後停止命令,您可以使用命令timeout

timeout 60 wget ... 

將在60秒後停止下載。

可以將持續時間之後添加可選的單元:

  • 's' 指秒(默認)
  • 的 'm' 爲分鐘
  • 'h' 的幾個小時
  • 'd'幾天