168

I am trying to download the files for a project using wget, as the SVN server for that project isn't running anymore and I am only able to access the files through a browser. The base URLs for all the files is the same like

http://abc.tamu.edu/projects/tzivi/repository/revisions/2/raw/tzivi/*

How can I use wget (or any other similar tool) to download all the files in this repository, where the "tzivi" folder is the root folder and there are several files and sub-folders (upto 2 or 3 levels) under it?

4

9 回答 9

232

您可以在 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下载整个 Internet,因为wget它将跟随它找到的每个链接。

于 2013-10-30T22:37:34.947 回答
23

您可以在外壳中使用它:

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)
于 2016-01-14T11:01:25.910 回答
8

这个链接给了我最好的答案:

$ wget --no-clobber --convert-links --random-wait -r -p --level 1 -E -e robots=off -U mozilla http://base.site/dir/

像魅力一样工作。

于 2020-02-04T22:56:59.987 回答
5
wget -r --no-parent URL --user=username --password=password

如果您有下载的用户名和密码,则最后两个选项是可选的,否则不需要使用它们。

您还可以在链接中查看更多选项https://www.howtogeek.com/281663/how-to-use-wget-the-ultimate-command-line-downloading-tool/

于 2018-09-05T11:28:05.077 回答
4

使用命令

wget -m www.ilanni.com/nexus/content/
于 2016-07-19T08:46:59.167 回答
2

你也可以使用这个命令:

wget --mirror -pc --convert-links -P ./your-local-dir/ http://www.your-website.com

以便您获得要下载的网站的确切镜像

于 2016-08-07T14:17:35.423 回答
1

试试这个工作代码(30-08-2021):

!wget --no-clobber --convert-links --random-wait -r -p --level 1 -E -e robots=off --adjust-extension -U mozilla "yourweb directory with in quotations"
于 2021-08-30T14:59:35.977 回答
-1

这将有助于

wget -m -np -c --level 0 --no-check-certificate -R"index.html*"http://www.your-websitepage.com/dir
于 2020-09-15T01:11:24.507 回答
-1

这有效:

wget -m -np -c --no-check-certificate -R "index.html*" "https://the-eye.eu/public/AudioBooks/Edgar%20Allan%20Poe%20-%2"
于 2018-05-04T04:59:33.453 回答