user3116888
user3116888

Reputation: 11

using wget to get selected subdirectories

I want to set up a cron job to download data from a server (http). Each directory is date/time-stamped in the format YYYYMMDDHH, where there are 2 versions daily, so HH is either 00 or 12. I only want a few of the subdirectories in each of those. eg the directory structure is website/2013121800/subdir/moresubdirs/file.
I tried using wget -A "*/subdir/*" but it started getting everything else. Is there a way to use wget to get only the desired subdirectories without explicitly setting the date/time?

Thanks.

Upvotes: 1

Views: 222

Answers (2)

Dominic B.
Dominic B.

Reputation: 1907

wget -X '/*/subdir'

should do the trick for you ;)

Upvotes: 1

rzymek
rzymek

Reputation: 9301

You need to use Directory-Based Limits instead of Types of Files contraints.

Use:

wget -X '/*/subdir'

Upvotes: 0

Related Questions