Hi Jan,

You seem to be using the option -X incorrectly. That option is valid only for 
exact directory names. It does not perform any regex matching. For your 
usecase, you want to use the --reject-regex command instead.

On Tue, Oct 19, 2021, at 22:03, Jan Nagel wrote:
> Hello,
>
> I'm trying to mirror a website "https://server.domain.com/"; using GNU 
> wget 1.21 (on Debian 12, "testing").
>
> I want to exclude the directory "https://server.domain.com/foo"; and all 
> subdirectories of "https://server.domain.com/bar";, but I want all files 
> in "https://server.domain.com/bar/"; to be included.
>
> So I run:
> wget --recursive -X "/foo,/bar/*" https://server.domain.com/
>
> This doesn't do what I expect it to do:
> The directory "https://server.domain.com/foo"; is excluded ... as 
> expected.
> Files in directory "https://server.domain.com/bar/"; are included ... as 
> expected.
> But subdirectories of "https://server.domain.com/bar/"; are included, 
> too.
>
> The man page says:
> "-X list
> --exclude-directories=list
> Specify a comma-separated list of directories you wish to exclude from 
> download.  Elements of list may contain wildcards."
>
> How can I prevent wget from downloading subdirectories of 
> "https://server.domain.com/bar/";?
>
> Am I using the wildcard "*" in the wrong way?
>
> Thanks for your help!
>
>
> Jan Nagel

Reply via email to