防止wget递归到排除的目录中

时间:2016-01-08 17:51:42

标签: admin wget downloading mirror server-administration

我在Mac上使用以下wget命令通过http镜像了远程Windows服务器上的文件:

wget --execute="robots = off" --mirror -N --no-parent -R '*index.html*' convert-links  -nH --cut-dirs=1 http://user:pass@domain.com/share/?C=M;O=D

这很好。

现在,服务器上的一些目录中的文件永远不会改变。我不希望wget打扰递归到那些目录。这些目录中有数千个文件,检查时间戳是浪费时间。我试图像这样排除这些目录:

wget --exclude-directories='*1. Council Meetings*,*3. Council Minutes*' --execute="robots = off" --mirror -N --no-parent -R '*index.html*' convert-links  -nH --cut-dirs=1 http://user:pass@domain.com/share/?C=M;O=D

但是尽管排除了这两个目录,wget仍然潜入其中并检查每个目录和被排除目录子目录中每个文件的时间戳。

我尝试了许多不同的通配符迭代,转义和引用/不引用等等,但没有成功。

1 个答案:

答案 0 :(得分:0)

为了使这个工作,我必须从根开始路径。所以,例如:

--exclude-directories='/root/stuff/*1. Council Meetings*