Difference between revisions of "Offline mirror with wget"
From Noah.org
Jump to navigationJump to searchm (Offline mirror moved to Offline mirror with wget) |
|||
Line 4: | Line 4: | ||
<pre> | <pre> | ||
− | wget - | + | wget --mirror --no-parent --page-requisites --convert-links --no-host-directories --cut-dirs=2 --directory-prefix=OUTPUT_DIR http://www.example.org/dir1/dir2/index.html |
</pre> | </pre> | ||
<pre> | <pre> | ||
− | - | + | --mirror : Mirror is currently equivalent to -r -N -l inf --no-remove-listing. |
− | - | + | --no-parent : Do not ascend to the parent directory. Only download files that are under the given URL. |
− | - | + | --page-requisites : Download all page requisites necessary to display the page (images, CSS, javascript, etc.). |
− | - | + | --convert-links : Convert links in the pages so that they work locally relative to the OUTPUT_DIR. |
− | - | + | --no-host-directories : Don't create host name directories. |
− | - | + | --cut-dirs=n : Remove n directories from the path of the URL. |
− | --cut-dirs=n : | + | --directory-prefix=<OUTPUT_DIR> : Set path to the destination directory where files will be saved. |
</pre> | </pre> |
Revision as of 04:10, 20 August 2008
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 --mirror --no-parent --page-requisites --convert-links --no-host-directories --cut-dirs=2 --directory-prefix=OUTPUT_DIR http://www.example.org/dir1/dir2/index.html
--mirror : Mirror is currently equivalent to -r -N -l inf --no-remove-listing. --no-parent : Do not ascend to the parent directory. Only download files that are under the given URL. --page-requisites : Download all page requisites necessary to display the page (images, CSS, javascript, etc.). --convert-links : Convert links in the pages so that they work locally relative to the OUTPUT_DIR. --no-host-directories : Don't create host name directories. --cut-dirs=n : Remove n directories from the path of the URL. --directory-prefix=<OUTPUT_DIR> : Set path to the destination directory where files will be saved.