WGET Download specific folders in apache directory

I want to load multiple folders in the same directories using wget , here is the apache directory structure.

 example.com/main/eschool/PhotoAlbum/Album/2008-10-13-citieneducationcenter/ example.com/main/eschool/PhotoAlbum/Album/2009-11-12-snfkdgjndfk/ example.com/main/eschool/PhotoAlbum/Album/2012-10-9-dsngosdgndfk/ 

...

Found pattern exists:

example.com/main/eschool/PhotoAlbum/Album/20* , can all of these folders be downloaded?

+6
source share
1 answer

If you want to download everything under example.com/main/eschool/PhotoAlbum/Album/ but not above it, you can use the --recursive and --no-parent options:

 wget --no-parent --recursive http://example.com/main/eschool/PhotoAlbum/Album/ 

This will load everything below the Album directory. If you want to limit the depth of diving wget into subdirectories, you can specify the --level option:

 wget --no-parent --recursive --level=3 http://example.com/main/eschool/PhotoAlbum/Album/ 

This will expand to 3 subdirectories below Album .

However, none of these methods filters by name - they will blindly load everything into the directory and its subdirectories. If you need more control (for example, to download albums starting with 20* ), you will have to use a script shell or scripting language.

+11
source

Source: https://habr.com/ru/post/948373/


All Articles