Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to make a full static copy of a wordpress website with wget to be browsed without any network connection (all links and images must be converted).

The different requisites for the pages (images, css, js, ...) are on 3 different wordpress hosts and are always on the same wp-content/uploads directories.

I tried to limit the recursion on the other domains to wp-content/uploads directories with --domains and --include-directories, but I can't limit wget to fetch only these directories on the $URL1 and $URL2.

Here is the command line (which don't limit to $URL0 and [$URL1|$URL2]/wp-content/uploads ) :

wget --convert-links --recursive -l inf -N -e robots=off -R -nc 
--default-page=index.html -E -D$URL1,$URL2,$URL0 --page-requisites 
-B$URL0 -X$URL1,$URL2 --cut-dirs=1 -I*/wp-content/uploads/*, -H -F $URL0

Are there any possibility to limit wget's recursion on the other domains to only some directories ?

share|improve this question
1  
Do I understand correctly that you want only directories below wp-content/uploads? If so, is the -np (no parent) flag what you're looking for? –  Kevin Dec 13 '11 at 19:18
add comment

2 Answers 2

wget --mirror --convert-links yourdomain.com
share|improve this answer
    
This seems like it does the opposite of what he asked; the man page says --mirror "sets infinite recursion depth" –  Michael Mrozek Nov 7 '11 at 12:29
3  
Also, could you tell us a bit about what the command actually does. Simply stating a command is not enough. –  MaxMackie Nov 8 '11 at 3:05
add comment

Think you might be looking for the include_directories switch?

From the manual:

‘include_directories = list’ ‘-I’ option accepts a comma-separated list of directories included in the retrieval. Any other directories will simply be ignored. The directories are absolute paths. So, if you wish to download from ‘http://host/people/bozo/’ following only links to bozo's colleagues in the /people directory and the bogus scripts in /cgi-bin, you can specify:

          wget -I /people,/cgi-bin http://host/people/bozo/
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.