robert laing
robert laing

Reputation: 1401

reject-regex with wget

mirroring a site with wget, i need to get out of an infinite loop of a dynamic web site calendar. basically i should need to mirror all the site

http://{site}/

but reject from mirroring all urls in this path:

http://{site}/calendar/

except from

http://{site}/calendar/2014-10
http://{site}/calendar/2014-11

how to to use --reject-regex? if i run something like:

ACCEPT='.*(?!/calendar).*|.*calendar/2014-1[01].*'
wget -r -p --accept-regex=$ACCEPT http://{site}

i got this error: Invalid preceding regular expression

Upvotes: 0

Views: 1274

Answers (1)

ededed
ededed

Reputation: 379

I guess you figured this out, but you have to put $ACCEPT in single quotes. The variable doesn't contain the necessary quotes.

wget -r -p --accept-regex='$ACCEPT' http://{site}

Upvotes: 1

Related Questions