我正在尝试使用wget
下载一个项目的文件,因为该项目的SVN服务器不再运行,并且我只能通过浏览器访问这些文件。所有文件的基本URL都是相同的,如下所示
http://abc.tamu.edu/projects/tzivi/repository/revisions/2/raw/tzivi/*
如何使用wget
(或任何其他类似工具)下载此存储库中的所有文件,其中"tzivi“文件夹是根文件夹,它下面有几个文件和子文件夹(最多2级或3级)?
发布于 2013-10-31 06:37:35
您可以在shell中使用以下代码:
wget -r --no-parent http://abc.tamu.edu/projects/tzivi/repository/revisions/2/raw/tzivi/
这些参数包括:
-r //recursive Download
和
--no-parent // Don´t download something from the parent directory
如果你不想下载全部内容,你可以使用:
-l1 just download the directory (tzivi in your case)
-l2 download the directory and all level 1 subfolders ('tzivi/something' but not 'tivizi/somthing/foo')
诸若此类。如果不插入-l
选项,wget
将自动使用-l 5
。
如果你插入一个-l 0
,你将下载整个互联网,因为wget
会跟踪它找到的每个链接。
发布于 2016-01-14 19:01:26
您可以在shell中使用以下代码:
wget -r -nH --cut-dirs=7 --reject="index.html*" \
http://abc.tamu.edu/projects/tzivi/repository/revisions/2/raw/tzivi/
这些参数包括:
-r recursively download
-nH (--no-host-directories) cuts out hostname
--cut-dirs=X (cuts out X directories)
发布于 2020-02-05 06:57:00
This link给了我最好的答案:
$ wget --no-clobber --convert-links --random-wait -r -p --level 1 -E -e robots=off -U mozilla http://base.site/dir/
就像一个护身符。
https://stackoverflow.com/questions/17282915
复制相似问题