bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wildcard and "--exclude-directories"


From: Darshit Shah
Subject: Re: wildcard and "--exclude-directories"
Date: Wed, 01 Dec 2021 22:53:13 +0100
User-agent: Cyrus-JMAP/3.5.0-alpha0-4458-g51a91c06b2-fm-20211130.004-g51a91c06

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

[Prev in Thread] Current Thread [Next in Thread]