P. 1
wget.pdf

wget.pdf

|Views: 27|Likes:
Published by wormbl
wget
wget

More info:

Published by: wormbl on Apr 09, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/04/2015

pdf

text

original

• If you wish Wget to keep a mirror of a page (or ftp subdirectories), use ‘--mirror’ (‘-m’),
which is the shorthand for ‘-r -l inf -N’. You can put Wget in the crontab fle asking it

to recheck a site each Sunday:

crontab

0 0 * * 0 wget --mirror http://www.gnu.org/ -o /home/me/weeklog

• In addition to the above, you want the links to be converted for local viewing. But, after
having read this manual, you know that link conversion doesn’t play well with timestamping,

so you also want Wget to back up the original html fles before the conversion. Wget

invocation would look like this:

wget --mirror --convert-links --backup-converted \

http://www.gnu.org/ -o /home/me/weeklog

• But you’ve also noticed that local viewing doesn’t work all that well when html fles
are saved under extensions other than ‘.html’, perhaps because they were served as

‘index.cgi’. So you’d like Wget to rename all the fles served with content-type ‘text/html’

or ‘application/xhtml+xml’ to ‘name.html’.

Chapter 7: Examples

46

wget --mirror --convert-links --backup-converted \

--html-extension -o /home/me/weeklog

\

http://www.gnu.org/

Or, with less typing:

wget -m -k -K -E http://www.gnu.org/ -o /home/me/weeklog

Chapter 8: Various

47

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->