Difference between revisions of "Offline mirror with wget"
From Noah.org
Jump to navigationJump to search (New page: Category:Engineering This downloads the given document and all parts it needs to be viewed offline. The number set by --cut-dirs must match the number of parent directories in the URL...) |
|||
Line 4: | Line 4: | ||
<pre> | <pre> | ||
− | wget -m -np -p -P OUTPUT_DIR -nH--cut-dirs=2 | + | wget -m -np -p -P OUTPUT_DIR -k -nH --cut-dirs=2 http://www.example.org/dir1/dir2/index.html |
+ | </pre> | ||
+ | |||
+ | <pre> | ||
+ | -m : Mirror. It is currently equivalent to -r -N -l inf --no-remove-listing. | ||
+ | -np : no parent files - only download files that are under the given URL. | ||
+ | -p : Download all page requisites to display the page. | ||
+ | -P <OUTPUT_DIR> : path to the mirror site destination | ||
+ | -k : convert links in the pages so that they work under the OUTPUT_DIR. | ||
+ | -nH : don't create host name directory. | ||
+ | --cut-dirs=n : remove n directories from the path of the URL. | ||
</pre> | </pre> |
Revision as of 16:11, 8 September 2007
This downloads the given document and all parts it needs to be viewed offline. The number set by --cut-dirs must match the number of parent directories in the URL (dir1 and dir2).
wget -m -np -p -P OUTPUT_DIR -k -nH --cut-dirs=2 http://www.example.org/dir1/dir2/index.html
-m : Mirror. It is currently equivalent to -r -N -l inf --no-remove-listing. -np : no parent files - only download files that are under the given URL. -p : Download all page requisites to display the page. -P <OUTPUT_DIR> : path to the mirror site destination -k : convert links in the pages so that they work under the OUTPUT_DIR. -nH : don't create host name directory. --cut-dirs=n : remove n directories from the path of the URL.