如何知道wget是否下载成功?

如何知道wget是否下载成功?

我尝试通过 wget 下载 openSUSE 12.1。
它在 64% 显示后停止:

05:54:48 (120.30 KB/s) - `openSUSE-12.1-DVD-i586.iso' saved 4429185024/4429185024]

看起来已经下载完成了,但是为什么只显示64%呢?

anisha@linux-2gbt:~> wget -c http://ftp.uni-bremen.de/pub/mirrors/opensuse/distribution/openSUSE-stable/iso/openSUSE-12.1-DVD-i586.iso
--11:39:58--  http://ftp.uni-bremen.de/pub/mirrors/opensuse/distribution/openSUSE-stable/iso/openSUSE-12.1-DVD-i586.iso
           => `openSUSE-12.1-DVD-i586.iso'
Resolving ftp.uni-bremen.de... 134.102.228.70
Connecting to ftp.uni-bremen.de|134.102.228.70|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4,429,185,024 (4.1G) [application/x-iso9660-image]

47% [===========================================>                                                  ] 2,425,434,388   --.--K/s  ETA 8:59:38

19:55:21 (79.70 KB/s) - Read error at byte 2425434388/4429185024 (Connection timed out). Retrying.

--19:55:22--  http://ftp.uni-bremen.de/pub/mirrors/opensuse/distribution/openSUSE-stable/iso/openSUSE-12.1-DVD-i586.iso
  (try: 2) => `openSUSE-12.1-DVD-i586.iso'
Connecting to ftp.uni-bremen.de|134.102.228.70|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4,429,185,024 (4.1G) [application/x-iso9660-image]

64% [===========================================================>                                  ] 4,429,185,024  192.61K/s  ETA 5:28:09

05:54:48 (120.30 KB/s) - `openSUSE-12.1-DVD-i586.iso' saved [4429185024/4429185024]

我尝试再次启动它,因为我使用了-c选项,如果下载真正完成,它不会再次开始下载,但它确实再次开始。我应该从中得出什么结论?

anisha@linux-2gbt:~> wget -c http://ftp.uni-bremen.de/pub/mirrors/opensuse/distribution/openSUSE-stable/iso/openSUSE-12.1-DVD-i586.iso
--08:50:56--  http://ftp.uni-bremen.de/pub/mirrors/opensuse/distribution/openSUSE-stable/iso/openSUSE-12.1-DVD-i586.iso
           => `openSUSE-12.1-DVD-i586.iso'
Resolving ftp.uni-bremen.de... 134.102.228.70
Connecting to ftp.uni-bremen.de|134.102.228.70|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4,429,185,024 (4.1G) [application/x-iso9660-image]

 2% [=>                                                                                              ] 207,066,532   93.31K/s ETA 15:56:35^C
anisha@linux-2gbt:~>    

答案1

说什么了$??通常,检查返回值会有所帮助。

另外,尝试根据互联网上的文件验证下载文件的 md5sum,以确保没问题。

相关内容