]> sjero.net Git - wget/blob - doc/wget.info-2
[svn] * wget.texi (Logging and Input File Options): -B / --base was not documented as
[wget] / doc / wget.info-2
1 This is Info file wget.info, produced by Makeinfo version 1.68 from the
2 input file ./wget.texi.
3
4 INFO-DIR-SECTION Net Utilities
5 INFO-DIR-SECTION World Wide Web
6 START-INFO-DIR-ENTRY
7 * Wget: (wget).         The non-interactive network downloader.
8 END-INFO-DIR-ENTRY
9
10    This file documents the the GNU Wget utility for downloading network
11 data.
12
13    Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
14
15    Permission is granted to make and distribute verbatim copies of this
16 manual provided the copyright notice and this permission notice are
17 preserved on all copies.
18
19    Permission is granted to copy and distribute modified versions of
20 this manual under the conditions for verbatim copying, provided also
21 that the sections entitled "Copying" and "GNU General Public License"
22 are included exactly as in the original, and provided that the entire
23 resulting derived work is distributed under the terms of a permission
24 notice identical to this one.
25
26 \1f
27 File: wget.info,  Node: HTTP Time-Stamping Internals,  Next: FTP Time-Stamping Internals,  Prev: Time-Stamping Usage,  Up: Time-Stamping
28
29 HTTP Time-Stamping Internals
30 ============================
31
32    Time-stamping in HTTP is implemented by checking of the
33 `Last-Modified' header.  If you wish to retrieve the file `foo.html'
34 through HTTP, Wget will check whether `foo.html' exists locally.  If it
35 doesn't, `foo.html' will be retrieved unconditionally.
36
37    If the file does exist locally, Wget will first check its local
38 time-stamp (similar to the way `ls -l' checks it), and then send a
39 `HEAD' request to the remote server, demanding the information on the
40 remote file.
41
42    The `Last-Modified' header is examined to find which file was
43 modified more recently (which makes it "newer").  If the remote file is
44 newer, it will be downloaded; if it is older, Wget will give up.(1)
45
46    When `--backup-converted' (`-K') is specified in conjunction with
47 `-N', server file `X' is compared to local file `X.orig', if extant,
48 rather than being compared to local file `X', which will always differ
49 if it's been converted by `--convert-links' (`-k').
50
51    Arguably, HTTP time-stamping should be implemented using the
52 `If-Modified-Since' request.
53
54    ---------- Footnotes ----------
55
56    (1) As an additional check, Wget will look at the `Content-Length'
57 header, and compare the sizes; if they are not the same, the remote
58 file will be downloaded no matter what the time-stamp says.
59
60 \1f
61 File: wget.info,  Node: FTP Time-Stamping Internals,  Prev: HTTP Time-Stamping Internals,  Up: Time-Stamping
62
63 FTP Time-Stamping Internals
64 ===========================
65
66    In theory, FTP time-stamping works much the same as HTTP, only FTP
67 has no headers--time-stamps must be received from the directory
68 listings.
69
70    For each directory files must be retrieved from, Wget will use the
71 `LIST' command to get the listing.  It will try to analyze the listing,
72 assuming that it is a Unix `ls -l' listing, and extract the
73 time-stamps.  The rest is exactly the same as for HTTP.
74
75    Assumption that every directory listing is a Unix-style listing may
76 sound extremely constraining, but in practice it is not, as many
77 non-Unix FTP servers use the Unixoid listing format because most (all?)
78 of the clients understand it.  Bear in mind that RFC959 defines no
79 standard way to get a file list, let alone the time-stamps.  We can
80 only hope that a future standard will define this.
81
82    Another non-standard solution includes the use of `MDTM' command
83 that is supported by some FTP servers (including the popular
84 `wu-ftpd'), which returns the exact time of the specified file.  Wget
85 may support this command in the future.
86
87 \1f
88 File: wget.info,  Node: Startup File,  Next: Examples,  Prev: Time-Stamping,  Up: Top
89
90 Startup File
91 ************
92
93    Once you know how to change default settings of Wget through command
94 line arguments, you may wish to make some of those settings permanent.
95 You can do that in a convenient way by creating the Wget startup
96 file--`.wgetrc'.
97
98    Besides `.wgetrc' is the "main" initialization file, it is
99 convenient to have a special facility for storing passwords.  Thus Wget
100 reads and interprets the contents of `$HOME/.netrc', if it finds it.
101 You can find `.netrc' format in your system manuals.
102
103    Wget reads `.wgetrc' upon startup, recognizing a limited set of
104 commands.
105
106 * Menu:
107
108 * Wgetrc Location::   Location of various wgetrc files.
109 * Wgetrc Syntax::     Syntax of wgetrc.
110 * Wgetrc Commands::   List of available commands.
111 * Sample Wgetrc::     A wgetrc example.
112
113 \1f
114 File: wget.info,  Node: Wgetrc Location,  Next: Wgetrc Syntax,  Prev: Startup File,  Up: Startup File
115
116 Wgetrc Location
117 ===============
118
119    When initializing, Wget will look for a "global" startup file,
120 `/usr/local/etc/wgetrc' by default (or some prefix other than
121 `/usr/local', if Wget was not installed there) and read commands from
122 there, if it exists.
123
124    Then it will look for the user's file.  If the environmental variable
125 `WGETRC' is set, Wget will try to load that file.  Failing that, no
126 further attempts will be made.
127
128    If `WGETRC' is not set, Wget will try to load `$HOME/.wgetrc'.
129
130    The fact that user's settings are loaded after the system-wide ones
131 means that in case of collision user's wgetrc *overrides* the
132 system-wide wgetrc (in `/usr/local/etc/wgetrc' by default).  Fascist
133 admins, away!
134
135 \1f
136 File: wget.info,  Node: Wgetrc Syntax,  Next: Wgetrc Commands,  Prev: Wgetrc Location,  Up: Startup File
137
138 Wgetrc Syntax
139 =============
140
141    The syntax of a wgetrc command is simple:
142
143      variable = value
144
145    The "variable" will also be called "command".  Valid "values" are
146 different for different commands.
147
148    The commands are case-insensitive and underscore-insensitive.  Thus
149 `DIr__PrefiX' is the same as `dirprefix'.  Empty lines, lines beginning
150 with `#' and lines containing white-space only are discarded.
151
152    Commands that expect a comma-separated list will clear the list on an
153 empty command.  So, if you wish to reset the rejection list specified in
154 global `wgetrc', you can do it with:
155
156      reject =
157
158 \1f
159 File: wget.info,  Node: Wgetrc Commands,  Next: Sample Wgetrc,  Prev: Wgetrc Syntax,  Up: Startup File
160
161 Wgetrc Commands
162 ===============
163
164    The complete set of commands is listed below, the letter after `='
165 denoting the value the command takes. It is `on/off' for `on' or `off'
166 (which can also be `1' or `0'), STRING for any non-empty string or N
167 for a positive integer.  For example, you may specify `use_proxy = off'
168 to disable use of proxy servers by default. You may use `inf' for
169 infinite values, where appropriate.
170
171    Most of the commands have their equivalent command-line option
172 (*Note Invoking::), except some more obscure or rarely used ones.
173
174 accept/reject = STRING
175      Same as `-A'/`-R' (*Note Types of Files::).
176
177 add_hostdir = on/off
178      Enable/disable host-prefixed file names.  `-nH' disables it.
179
180 continue = on/off
181      Enable/disable continuation of the retrieval - the same as `-c'
182      (which enables it).
183
184 background = on/off
185      Enable/disable going to background - the same as `-b' (which
186      enables it).
187
188 backup_converted = on/off
189      Enable/disable saving pre-converted files with the suffix `.orig'
190      - the same as `-K' (which enables it).
191
192 base = STRING
193      Consider relative URLs in URL input files forced to be interpreted
194      as HTML as being relative to STRING - the same as `-B'.
195
196 cache = on/off
197      When set to off, disallow server-caching.  See the `-C' option.
198
199 convert links = on/off
200      Convert non-relative links locally.  The same as `-k'.
201
202 cut_dirs = N
203      Ignore N remote directory components.
204
205 debug = on/off
206      Debug mode, same as `-d'.
207
208 delete_after = on/off
209      Delete after download - the same as `--delete-after'.
210
211 dir_prefix = STRING
212      Top of directory tree - the same as `-P'.
213
214 dirstruct = on/off
215      Turning dirstruct on or off - the same as `-x' or `-nd',
216      respectively.
217
218 domains = STRING
219      Same as `-D' (*Note Domain Acceptance::).
220
221 dot_bytes = N
222      Specify the number of bytes "contained" in a dot, as seen
223      throughout the retrieval (1024 by default).  You can postfix the
224      value with `k' or `m', representing kilobytes and megabytes,
225      respectively.  With dot settings you can tailor the dot retrieval
226      to suit your needs, or you can use the predefined "styles" (*Note
227      Download Options::).
228
229 dots_in_line = N
230      Specify the number of dots that will be printed in each line
231      throughout the retrieval (50 by default).
232
233 dot_spacing = N
234      Specify the number of dots in a single cluster (10 by default).
235
236 dot_style = STRING
237      Specify the dot retrieval "style", as with `--dot-style'.
238
239 exclude_directories = STRING
240      Specify a comma-separated list of directories you wish to exclude
241      from download - the same as `-X' (*Note Directory-Based Limits::).
242
243 exclude_domains = STRING
244      Same as `--exclude-domains' (*Note Domain Acceptance::).
245
246 follow_ftp = on/off
247      Follow FTP links from HTML documents - the same as `-f'.
248
249 follow_tags = STRING
250      Only follow certain HTML tags when doing a recursive retrieval,
251      just like `--follow-tags'.
252
253 force_html = on/off
254      If set to on, force the input filename to be regarded as an HTML
255      document - the same as `-F'.
256
257 ftp_proxy = STRING
258      Use STRING as FTP proxy, instead of the one specified in
259      environment.
260
261 glob = on/off
262      Turn globbing on/off - the same as `-g'.
263
264 header = STRING
265      Define an additional header, like `--header'.
266
267 http_passwd = STRING
268      Set HTTP password.
269
270 http_proxy = STRING
271      Use STRING as HTTP proxy, instead of the one specified in
272      environment.
273
274 http_user = STRING
275      Set HTTP user to STRING.
276
277 ignore_length = on/off
278      When set to on, ignore `Content-Length' header; the same as
279      `--ignore-length'.
280
281 ignore_tags = STRING
282      Ignore certain HTML tags when doing a recursive retrieval, just
283      like `-G' / `--ignore-tags'.
284
285 include_directories = STRING
286      Specify a comma-separated list of directories you wish to follow
287      when downloading - the same as `-I'.
288
289 input = STRING
290      Read the URLs from STRING, like `-i'.
291
292 kill_longer = on/off
293      Consider data longer than specified in content-length header as
294      invalid (and retry getting it). The default behaviour is to save
295      as much data as there is, provided there is more than or equal to
296      the value in `Content-Length'.
297
298 logfile = STRING
299      Set logfile - the same as `-o'.
300
301 login = STRING
302      Your user name on the remote machine, for FTP.  Defaults to
303      `anonymous'.
304
305 mirror = on/off
306      Turn mirroring on/off.  The same as `-m'.
307
308 netrc = on/off
309      Turn reading netrc on or off.
310
311 noclobber = on/off
312      Same as `-nc'.
313
314 no_parent = on/off
315      Disallow retrieving outside the directory hierarchy, like
316      `--no-parent' (*Note Directory-Based Limits::).
317
318 no_proxy = STRING
319      Use STRING as the comma-separated list of domains to avoid in
320      proxy loading, instead of the one specified in environment.
321
322 output_document = STRING
323      Set the output filename - the same as `-O'.
324
325 passive_ftp = on/off
326      Set passive FTP - the same as `--passive-ftp'.
327
328 passwd = STRING
329      Set your FTP password to PASSWORD.  Without this setting, the
330      password defaults to `username@hostname.domainname'.
331
332 proxy_user = STRING
333      Set proxy authentication user name to STRING, like `--proxy-user'.
334
335 proxy_passwd = STRING
336      Set proxy authentication password to STRING, like `--proxy-passwd'.
337
338 quiet = on/off
339      Quiet mode - the same as `-q'.
340
341 quota = QUOTA
342      Specify the download quota, which is useful to put in the global
343      `wgetrc'. When download quota is specified, Wget will stop
344      retrieving after the download sum has become greater than quota.
345      The quota can be specified in bytes (default), kbytes `k'
346      appended) or mbytes (`m' appended).  Thus `quota = 5m' will set
347      the quota to 5 mbytes. Note that the user's startup file overrides
348      system settings.
349
350 reclevel = N
351      Recursion level - the same as `-l'.
352
353 recursive = on/off
354      Recursive on/off - the same as `-r'.
355
356 relative_only = on/off
357      Follow only relative links - the same as `-L' (*Note Relative
358      Links::).
359
360 remove_listing = on/off
361      If set to on, remove FTP listings downloaded by Wget.  Setting it
362      to off is the same as `-nr'.
363
364 retr_symlinks = on/off
365      When set to on, retrieve symbolic links as if they were plain
366      files; the same as `--retr-symlinks'.
367
368 robots = on/off
369      Use (or not) `/robots.txt' file (*Note Robots::).  Be sure to know
370      what you are doing before changing the default (which is `on').
371
372 server_response = on/off
373      Choose whether or not to print the HTTP and FTP server responses -
374      the same as `-S'.
375
376 simple_host_check = on/off
377      Same as `-nh' (*Note Host Checking::).
378
379 span_hosts = on/off
380      Same as `-H'.
381
382 timeout = N
383      Set timeout value - the same as `-T'.
384
385 timestamping = on/off
386      Turn timestamping on/off. The same as `-N' (*Note Time-Stamping::).
387
388 tries = N
389      Set number of retries per URL - the same as `-t'.
390
391 use_proxy = on/off
392      Turn proxy support on/off. The same as `-Y'.
393
394 verbose = on/off
395      Turn verbose on/off - the same as `-v'/`-nv'.
396
397 wait = N
398      Wait N seconds between retrievals - the same as `-w'.
399
400 waitretry = N
401      Wait up to N seconds between retries of failed retrievals only -
402      the same as `--waitretry'.  Note that this is turned on by default
403      in the global `wgetrc'.
404
405 \1f
406 File: wget.info,  Node: Sample Wgetrc,  Prev: Wgetrc Commands,  Up: Startup File
407
408 Sample Wgetrc
409 =============
410
411    This is the sample initialization file, as given in the distribution.
412 It is divided in two section--one for global usage (suitable for global
413 startup file), and one for local usage (suitable for `$HOME/.wgetrc').
414 Be careful about the things you change.
415
416    Note that almost all the lines are commented out.  For a command to
417 have any effect, you must remove the `#' character at the beginning of
418 its line.
419
420      ###
421      ### Sample Wget initialization file .wgetrc
422      ###
423      
424      ## You can use this file to change the default behaviour of wget or to
425      ## avoid having to type many many command-line options. This file does
426      ## not contain a comprehensive list of commands -- look at the manual
427      ## to find out what you can put into this file.
428      ##
429      ## Wget initialization file can reside in /usr/local/etc/wgetrc
430      ## (global, for all users) or $HOME/.wgetrc (for a single user).
431      ##
432      ## To use the settings in this file, you will have to uncomment them,
433      ## as well as change them, in most cases, as the values on the
434      ## commented-out lines are the default values (e.g. "off").
435      
436      
437      ##
438      ## Global settings (useful for setting up in /usr/local/etc/wgetrc).
439      ## Think well before you change them, since they may reduce wget's
440      ## functionality, and make it behave contrary to the documentation:
441      ##
442      
443      # You can set retrieve quota for beginners by specifying a value
444      # optionally followed by 'K' (kilobytes) or 'M' (megabytes).  The
445      # default quota is unlimited.
446      #quota = inf
447      
448      # You can lower (or raise) the default number of retries when
449      # downloading a file (default is 20).
450      #tries = 20
451      
452      # Lowering the maximum depth of the recursive retrieval is handy to
453      # prevent newbies from going too "deep" when they unwittingly start
454      # the recursive retrieval.  The default is 5.
455      #reclevel = 5
456      
457      # Many sites are behind firewalls that do not allow initiation of
458      # connections from the outside.  On these sites you have to use the
459      # `passive' feature of FTP.  If you are behind such a firewall, you
460      # can turn this on to make Wget use passive FTP by default.
461      #passive_ftp = off
462      
463      # The "wait" command below makes Wget wait between every connection.
464      # If, instead, you want Wget to wait only between retries of failed
465      # downloads, set waitretry to maximum number of seconds to wait (Wget
466      # will use "linear backoff", waiting 1 second after the first failure
467      # on a file, 2 seconds after the second failure, etc. up to this max).
468      waitretry = 10
469      
470      
471      ##
472      ## Local settings (for a user to set in his $HOME/.wgetrc).  It is
473      ## *highly* undesirable to put these settings in the global file, since
474      ## they are potentially dangerous to "normal" users.
475      ##
476      ## Even when setting up your own ~/.wgetrc, you should know what you
477      ## are doing before doing so.
478      ##
479      
480      # Set this to on to use timestamping by default:
481      #timestamping = off
482      
483      # It is a good idea to make Wget send your email address in a `From:'
484      # header with your request (so that server administrators can contact
485      # you in case of errors).  Wget does *not* send `From:' by default.
486      #header = From: Your Name <username@site.domain>
487      
488      # You can set up other headers, like Accept-Language.  Accept-Language
489      # is *not* sent by default.
490      #header = Accept-Language: en
491      
492      # You can set the default proxy for Wget to use.  It will override the
493      # value in the environment.
494      #http_proxy = http://proxy.yoyodyne.com:18023/
495      
496      # If you do not want to use proxy at all, set this to off.
497      #use_proxy = on
498      
499      # You can customize the retrieval outlook.  Valid options are default,
500      # binary, mega and micro.
501      #dot_style = default
502      
503      # Setting this to off makes Wget not download /robots.txt.  Be sure to
504      # know *exactly* what /robots.txt is and how it is used before changing
505      # the default!
506      #robots = on
507      
508      # It can be useful to make Wget wait between connections.  Set this to
509      # the number of seconds you want Wget to wait.
510      #wait = 0
511      
512      # You can force creating directory structure, even if a single is being
513      # retrieved, by setting this to on.
514      #dirstruct = off
515      
516      # You can turn on recursive retrieving by default (don't do this if
517      # you are not sure you know what it means) by setting this to on.
518      #recursive = off
519      
520      # To always back up file X as X.orig before converting its links (due
521      # to -k / --convert-links / convert_links = on having been specified),
522      # set this variable to on:
523      #backup_converted = off
524      
525      # To have Wget follow FTP links from HTML files by default, set this
526      # to on:
527      #follow_ftp = off
528
529 \1f
530 File: wget.info,  Node: Examples,  Next: Various,  Prev: Startup File,  Up: Top
531
532 Examples
533 ********
534
535    The examples are classified into three sections, because of clarity.
536 The first section is a tutorial for beginners.  The second section
537 explains some of the more complex program features.  The third section
538 contains advice for mirror administrators, as well as even more complex
539 features (that some would call perverted).
540
541 * Menu:
542
543 * Simple Usage::        Simple, basic usage of the program.
544 * Advanced Usage::      Advanced techniques of usage.
545 * Guru Usage::          Mirroring and the hairy stuff.
546
547 \1f
548 File: wget.info,  Node: Simple Usage,  Next: Advanced Usage,  Prev: Examples,  Up: Examples
549
550 Simple Usage
551 ============
552
553    * Say you want to download a URL.  Just type:
554
555           wget http://fly.cc.fer.hr/
556
557      The response will be something like:
558
559           --13:30:45--  http://fly.cc.fer.hr:80/en/
560                      => `index.html'
561           Connecting to fly.cc.fer.hr:80... connected!
562           HTTP request sent, awaiting response... 200 OK
563           Length: 4,694 [text/html]
564           
565               0K -> ....                                                   [100%]
566           
567           13:30:46 (23.75 KB/s) - `index.html' saved [4694/4694]
568
569    * But what will happen if the connection is slow, and the file is
570      lengthy?  The connection will probably fail before the whole file
571      is retrieved, more than once.  In this case, Wget will try getting
572      the file until it either gets the whole of it, or exceeds the
573      default number of retries (this being 20).  It is easy to change
574      the number of tries to 45, to insure that the whole file will
575      arrive safely:
576
577           wget --tries=45 http://fly.cc.fer.hr/jpg/flyweb.jpg
578
579    * Now let's leave Wget to work in the background, and write its
580      progress to log file `log'.  It is tiring to type `--tries', so we
581      shall use `-t'.
582
583           wget -t 45 -o log http://fly.cc.fer.hr/jpg/flyweb.jpg &
584
585      The ampersand at the end of the line makes sure that Wget works in
586      the background.  To unlimit the number of retries, use `-t inf'.
587
588    * The usage of FTP is as simple.  Wget will take care of login and
589      password.
590
591           $ wget ftp://gnjilux.cc.fer.hr/welcome.msg
592           --10:08:47--  ftp://gnjilux.cc.fer.hr:21/welcome.msg
593                      => `welcome.msg'
594           Connecting to gnjilux.cc.fer.hr:21... connected!
595           Logging in as anonymous ... Logged in!
596           ==> TYPE I ... done.  ==> CWD not needed.
597           ==> PORT ... done.    ==> RETR welcome.msg ... done.
598           Length: 1,340 (unauthoritative)
599           
600               0K -> .                                                      [100%]
601           
602           10:08:48 (1.28 MB/s) - `welcome.msg' saved [1340]
603
604    * If you specify a directory, Wget will retrieve the directory
605      listing, parse it and convert it to HTML.  Try:
606
607           wget ftp://prep.ai.mit.edu/pub/gnu/
608           lynx index.html
609
610 \1f
611 File: wget.info,  Node: Advanced Usage,  Next: Guru Usage,  Prev: Simple Usage,  Up: Examples
612
613 Advanced Usage
614 ==============
615
616    * You would like to read the list of URLs from a file?  Not a problem
617      with that:
618
619           wget -i file
620
621      If you specify `-' as file name, the URLs will be read from
622      standard input.
623
624    * Create a mirror image of GNU WWW site (with the same directory
625      structure the original has) with only one try per document, saving
626      the log of the activities to `gnulog':
627
628           wget -r -t1 http://www.gnu.ai.mit.edu/ -o gnulog
629
630    * Retrieve the first layer of yahoo links:
631
632           wget -r -l1 http://www.yahoo.com/
633
634    * Retrieve the index.html of `www.lycos.com', showing the original
635      server headers:
636
637           wget -S http://www.lycos.com/
638
639    * Save the server headers with the file:
640           wget -s http://www.lycos.com/
641           more index.html
642
643    * Retrieve the first two levels of `wuarchive.wustl.edu', saving them
644      to /tmp.
645
646           wget -P/tmp -l2 ftp://wuarchive.wustl.edu/
647
648    * You want to download all the GIFs from an HTTP directory.  `wget
649      http://host/dir/*.gif' doesn't work, since HTTP retrieval does not
650      support globbing.  In that case, use:
651
652           wget -r -l1 --no-parent -A.gif http://host/dir/
653
654      It is a bit of a kludge, but it works.  `-r -l1' means to retrieve
655      recursively (*Note Recursive Retrieval::), with maximum depth of 1.
656      `--no-parent' means that references to the parent directory are
657      ignored (*Note Directory-Based Limits::), and `-A.gif' means to
658      download only the GIF files.  `-A "*.gif"' would have worked too.
659
660    * Suppose you were in the middle of downloading, when Wget was
661      interrupted.  Now you do not want to clobber the files already
662      present.  It would be:
663
664           wget -nc -r http://www.gnu.ai.mit.edu/
665
666    * If you want to encode your own username and password to HTTP or
667      FTP, use the appropriate URL syntax (*Note URL Format::).
668
669           wget ftp://hniksic:mypassword@jagor.srce.hr/.emacs
670
671    * If you do not like the default retrieval visualization (1K dots
672      with 10 dots per cluster and 50 dots per line), you can customize
673      it through dot settings (*Note Wgetrc Commands::).  For example,
674      many people like the "binary" style of retrieval, with 8K dots and
675      512K lines:
676
677           wget --dot-style=binary ftp://prep.ai.mit.edu/pub/gnu/README
678
679      You can experiment with other styles, like:
680
681           wget --dot-style=mega ftp://ftp.xemacs.org/pub/xemacs/xemacs-20.4/xemacs-20.4.tar.gz
682           wget --dot-style=micro http://fly.cc.fer.hr/
683
684      To make these settings permanent, put them in your `.wgetrc', as
685      described before (*Note Sample Wgetrc::).
686
687 \1f
688 File: wget.info,  Node: Guru Usage,  Prev: Advanced Usage,  Up: Examples
689
690 Guru Usage
691 ==========
692
693    * If you wish Wget to keep a mirror of a page (or FTP
694      subdirectories), use `--mirror' (`-m'), which is the shorthand for
695      `-r -N'.  You can put Wget in the crontab file asking it to
696      recheck a site each Sunday:
697
698           crontab
699           0 0 * * 0 wget --mirror ftp://ftp.xemacs.org/pub/xemacs/ -o /home/me/weeklog
700
701    * You may wish to do the same with someone's home page.  But you do
702      not want to download all those images--you're only interested in
703      HTML.
704
705           wget --mirror -A.html http://www.w3.org/
706
707    * But what about mirroring the hosts networkologically close to you?
708      It seems so awfully slow because of all that DNS resolving.  Just
709      use `-D' (*Note Domain Acceptance::).
710
711           wget -rN -Dsrce.hr http://www.srce.hr/
712
713      Now Wget will correctly find out that `regoc.srce.hr' is the same
714      as `www.srce.hr', but will not even take into consideration the
715      link to `www.mit.edu'.
716
717    * You have a presentation and would like the dumb absolute links to
718      be converted to relative?  Use `-k':
719
720           wget -k -r URL
721
722    * You would like the output documents to go to standard output
723      instead of to files?  OK, but Wget will automatically shut up
724      (turn on `--quiet') to prevent mixing of Wget output and the
725      retrieved documents.
726
727           wget -O - http://jagor.srce.hr/ http://www.srce.hr/
728
729      You can also combine the two options and make weird pipelines to
730      retrieve the documents from remote hotlists:
731
732           wget -O - http://cool.list.com/ | wget --force-html -i -
733
734 \1f
735 File: wget.info,  Node: Various,  Next: Appendices,  Prev: Examples,  Up: Top
736
737 Various
738 *******
739
740    This chapter contains all the stuff that could not fit anywhere else.
741
742 * Menu:
743
744 * Proxies::             Support for proxy servers
745 * Distribution::        Getting the latest version.
746 * Mailing List::        Wget mailing list for announcements and discussion.
747 * Reporting Bugs::      How and where to report bugs.
748 * Portability::         The systems Wget works on.
749 * Signals::             Signal-handling performed by Wget.
750
751 \1f
752 File: wget.info,  Node: Proxies,  Next: Distribution,  Prev: Various,  Up: Various
753
754 Proxies
755 =======
756
757    "Proxies" are special-purpose HTTP servers designed to transfer data
758 from remote servers to local clients.  One typical use of proxies is
759 lightening network load for users behind a slow connection.  This is
760 achieved by channeling all HTTP and FTP requests through the proxy
761 which caches the transferred data.  When a cached resource is requested
762 again, proxy will return the data from cache.  Another use for proxies
763 is for companies that separate (for security reasons) their internal
764 networks from the rest of Internet.  In order to obtain information
765 from the Web, their users connect and retrieve remote data using an
766 authorized proxy.
767
768    Wget supports proxies for both HTTP and FTP retrievals.  The
769 standard way to specify proxy location, which Wget recognizes, is using
770 the following environment variables:
771
772 `http_proxy'
773      This variable should contain the URL of the proxy for HTTP
774      connections.
775
776 `ftp_proxy'
777      This variable should contain the URL of the proxy for HTTP
778      connections.  It is quite common that HTTP_PROXY and FTP_PROXY are
779      set to the same URL.
780
781 `no_proxy'
782      This variable should contain a comma-separated list of domain
783      extensions proxy should *not* be used for.  For instance, if the
784      value of `no_proxy' is `.mit.edu', proxy will not be used to
785      retrieve documents from MIT.
786
787    In addition to the environment variables, proxy location and settings
788 may be specified from within Wget itself.
789
790 `-Y on/off'
791 `--proxy=on/off'
792 `proxy = on/off'
793      This option may be used to turn the proxy support on or off.  Proxy
794      support is on by default, provided that the appropriate environment
795      variables are set.
796
797 `http_proxy = URL'
798 `ftp_proxy = URL'
799 `no_proxy = STRING'
800      These startup file variables allow you to override the proxy
801      settings specified by the environment.
802
803    Some proxy servers require authorization to enable you to use them.
804 The authorization consists of "username" and "password", which must be
805 sent by Wget.  As with HTTP authorization, several authentication
806 schemes exist.  For proxy authorization only the `Basic' authentication
807 scheme is currently implemented.
808
809    You may specify your username and password either through the proxy
810 URL or through the command-line options.  Assuming that the company's
811 proxy is located at `proxy.srce.hr' at port 8001, a proxy URL location
812 containing authorization data might look like this:
813
814      http://hniksic:mypassword@proxy.company.com:8001/
815
816    Alternatively, you may use the `proxy-user' and `proxy-password'
817 options, and the equivalent `.wgetrc' settings `proxy_user' and
818 `proxy_passwd' to set the proxy username and password.
819
820 \1f
821 File: wget.info,  Node: Distribution,  Next: Mailing List,  Prev: Proxies,  Up: Various
822
823 Distribution
824 ============
825
826    Like all GNU utilities, the latest version of Wget can be found at
827 the master GNU archive site prep.ai.mit.edu, and its mirrors.  For
828 example, Wget 1.5.3+dev can be found at
829 `ftp://prep.ai.mit.edu/gnu/wget/wget-1.5.3+dev.tar.gz'
830
831 \1f
832 File: wget.info,  Node: Mailing List,  Next: Reporting Bugs,  Prev: Distribution,  Up: Various
833
834 Mailing List
835 ============
836
837    Wget has its own mailing list at <wget@sunsite.auc.dk>, thanks to
838 Karsten Thygesen.  The mailing list is for discussion of Wget features
839 and web, reporting Wget bugs (those that you think may be of interest
840 to the public) and mailing announcements.  You are welcome to
841 subscribe.  The more people on the list, the better!
842
843    To subscribe, send mail to <wget-subscribe@sunsite.auc.dk>.  the
844 magic word `subscribe' in the subject line.  Unsubscribe by mailing to
845 <wget-unsubscribe@sunsite.auc.dk>.
846
847    The mailing list is archived at `http://fly.cc.fer.hr/archive/wget'.
848
849 \1f
850 File: wget.info,  Node: Reporting Bugs,  Next: Portability,  Prev: Mailing List,  Up: Various
851
852 Reporting Bugs
853 ==============
854
855    You are welcome to send bug reports about GNU Wget to
856 <bug-wget@gnu.org>.  The bugs that you think are of the interest to the
857 public (i.e. more people should be informed about them) can be Cc-ed to
858 the mailing list at <wget@sunsite.auc.dk>.
859
860    Before actually submitting a bug report, please try to follow a few
861 simple guidelines.
862
863   1. Please try to ascertain that the behaviour you see really is a
864      bug.  If Wget crashes, it's a bug.  If Wget does not behave as
865      documented, it's a bug.  If things work strange, but you are not
866      sure about the way they are supposed to work, it might well be a
867      bug.
868
869   2. Try to repeat the bug in as simple circumstances as possible.
870      E.g. if Wget crashes on `wget -rLl0 -t5 -Y0 http://yoyodyne.com -o
871      /tmp/log', you should try to see if it will crash with a simpler
872      set of options.
873
874      Also, while I will probably be interested to know the contents of
875      your `.wgetrc' file, just dumping it into the debug message is
876      probably a bad idea.  Instead, you should first try to see if the
877      bug repeats with `.wgetrc' moved out of the way.  Only if it turns
878      out that `.wgetrc' settings affect the bug, should you mail me the
879      relevant parts of the file.
880
881   3. Please start Wget with `-d' option and send the log (or the
882      relevant parts of it).  If Wget was compiled without debug support,
883      recompile it.  It is *much* easier to trace bugs with debug support
884      on.
885
886   4. If Wget has crashed, try to run it in a debugger, e.g. `gdb `which
887      wget` core' and type `where' to get the backtrace.
888
889   5. Find where the bug is, fix it and send me the patches. :-)
890
891 \1f
892 File: wget.info,  Node: Portability,  Next: Signals,  Prev: Reporting Bugs,  Up: Various
893
894 Portability
895 ===========
896
897    Since Wget uses GNU Autoconf for building and configuring, and avoids
898 using "special" ultra-mega-cool features of any particular Unix, it
899 should compile (and work) on all common Unix flavors.
900
901    Various Wget versions have been compiled and tested under many kinds
902 of Unix systems, including Solaris, Linux, SunOS, OSF (aka Digital
903 Unix), Ultrix, *BSD, IRIX, and others; refer to the file `MACHINES' in
904 the distribution directory for a comprehensive list.  If you compile it
905 on an architecture not listed there, please let me know so I can update
906 it.
907
908    Wget should also compile on the other Unix systems, not listed in
909 `MACHINES'.  If it doesn't, please let me know.
910
911    Thanks to kind contributors, this version of Wget compiles and works
912 on Microsoft Windows 95 and Windows NT platforms.  It has been compiled
913 successfully using MS Visual C++ 4.0, Watcom, and Borland C compilers,
914 with Winsock as networking software.  Naturally, it is crippled of some
915 features available on Unix, but it should work as a substitute for
916 people stuck with Windows.  Note that the Windows port is *neither
917 tested nor maintained* by me--all questions and problems should be
918 reported to Wget mailing list at <wget@sunsite.auc.dk> where the
919 maintainers will look at them.
920
921 \1f
922 File: wget.info,  Node: Signals,  Prev: Portability,  Up: Various
923
924 Signals
925 =======
926
927    Since the purpose of Wget is background work, it catches the hangup
928 signal (`SIGHUP') and ignores it.  If the output was on standard
929 output, it will be redirected to a file named `wget-log'.  Otherwise,
930 `SIGHUP' is ignored.  This is convenient when you wish to redirect the
931 output of Wget after having started it.
932
933      $ wget http://www.ifi.uio.no/~larsi/gnus.tar.gz &
934      $ kill -HUP %%     # Redirect the output to wget-log
935
936    Other than that, Wget will not try to interfere with signals in any
937 way. `C-c', `kill -TERM' and `kill -KILL' should kill it alike.
938
939 \1f
940 File: wget.info,  Node: Appendices,  Next: Copying,  Prev: Various,  Up: Top
941
942 Appendices
943 **********
944
945    This chapter contains some references I consider useful, like the
946 Robots Exclusion Standard specification, as well as a list of
947 contributors to GNU Wget.
948
949 * Menu:
950
951 * Robots::                  Wget as a WWW robot.
952 * Security Considerations:: Security with Wget.
953 * Contributors::            People who helped.
954
955 \1f
956 File: wget.info,  Node: Robots,  Next: Security Considerations,  Prev: Appendices,  Up: Appendices
957
958 Robots
959 ======
960
961    Since Wget is able to traverse the web, it counts as one of the Web
962 "robots".  Thus Wget understands "Robots Exclusion Standard"
963 (RES)--contents of `/robots.txt', used by server administrators to
964 shield parts of their systems from wanderings of Wget.
965
966    Norobots support is turned on only when retrieving recursively, and
967 *never* for the first page.  Thus, you may issue:
968
969      wget -r http://fly.cc.fer.hr/
970
971    First the index of fly.cc.fer.hr will be downloaded.  If Wget finds
972 anything worth downloading on the same host, only *then* will it load
973 the robots, and decide whether or not to load the links after all.
974 `/robots.txt' is loaded only once per host.  Wget does not support the
975 robots `META' tag.
976
977    The description of the norobots standard was written, and is
978 maintained by Martijn Koster <m.koster@webcrawler.com>.  With his
979 permission, I contribute a (slightly modified) TeXified version of the
980 RES.
981
982 * Menu:
983
984 * Introduction to RES::
985 * RES Format::
986 * User-Agent Field::
987 * Disallow Field::
988 * Norobots Examples::
989
990 \1f
991 File: wget.info,  Node: Introduction to RES,  Next: RES Format,  Prev: Robots,  Up: Robots
992
993 Introduction to RES
994 -------------------
995
996    "WWW Robots" (also called "wanderers" or "spiders") are programs
997 that traverse many pages in the World Wide Web by recursively
998 retrieving linked pages. For more information see the robots page.
999
1000    In 1993 and 1994 there have been occasions where robots have visited
1001 WWW servers where they weren't welcome for various reasons. Sometimes
1002 these reasons were robot specific, e.g. certain robots swamped servers
1003 with rapid-fire requests, or retrieved the same files repeatedly. In
1004 other situations robots traversed parts of WWW servers that weren't
1005 suitable, e.g. very deep virtual trees, duplicated information,
1006 temporary information, or cgi-scripts with side-effects (such as
1007 voting).
1008
1009    These incidents indicated the need for established mechanisms for
1010 WWW servers to indicate to robots which parts of their server should
1011 not be accessed. This standard addresses this need with an operational
1012 solution.
1013
1014    This document represents a consensus on 30 June 1994 on the robots
1015 mailing list (`robots@webcrawler.com'), between the majority of robot
1016 authors and other people with an interest in robots. It has also been
1017 open for discussion on the Technical World Wide Web mailing list
1018 (`www-talk@info.cern.ch'). This document is based on a previous working
1019 draft under the same title.
1020
1021    It is not an official standard backed by a standards body, or owned
1022 by any commercial organization. It is not enforced by anybody, and there
1023 no guarantee that all current and future robots will use it. Consider
1024 it a common facility the majority of robot authors offer the WWW
1025 community to protect WWW server against unwanted accesses by their
1026 robots.
1027
1028    The latest version of this document can be found at
1029 `http://info.webcrawler.com/mak/projects/robots/norobots.html'.
1030
1031 \1f
1032 File: wget.info,  Node: RES Format,  Next: User-Agent Field,  Prev: Introduction to RES,  Up: Robots
1033
1034 RES Format
1035 ----------
1036
1037    The format and semantics of the `/robots.txt' file are as follows:
1038
1039    The file consists of one or more records separated by one or more
1040 blank lines (terminated by `CR', `CR/NL', or `NL').  Each record
1041 contains lines of the form:
1042
1043      <field>:<optionalspace><value><optionalspace>
1044
1045    The field name is case insensitive.
1046
1047    Comments can be included in file using UNIX Bourne shell conventions:
1048 the `#' character is used to indicate that preceding space (if any) and
1049 the remainder of the line up to the line termination is discarded.
1050 Lines containing only a comment are discarded completely, and therefore
1051 do not indicate a record boundary.
1052
1053    The record starts with one or more User-agent lines, followed by one
1054 or more Disallow lines, as detailed below. Unrecognized headers are
1055 ignored.
1056
1057    The presence of an empty `/robots.txt' file has no explicit
1058 associated semantics, it will be treated as if it was not present, i.e.
1059 all robots will consider themselves welcome.
1060
1061 \1f
1062 File: wget.info,  Node: User-Agent Field,  Next: Disallow Field,  Prev: RES Format,  Up: Robots
1063
1064 User-Agent Field
1065 ----------------
1066
1067    The value of this field is the name of the robot the record is
1068 describing access policy for.
1069
1070    If more than one User-agent field is present the record describes an
1071 identical access policy for more than one robot.  At least one field
1072 needs to be present per record.
1073
1074    The robot should be liberal in interpreting this field. A case
1075 insensitive substring match of the name without version information is
1076 recommended.
1077
1078    If the value is `*', the record describes the default access policy
1079 for any robot that has not matched any of the other records. It is not
1080 allowed to have multiple such records in the `/robots.txt' file.
1081
1082 \1f
1083 File: wget.info,  Node: Disallow Field,  Next: Norobots Examples,  Prev: User-Agent Field,  Up: Robots
1084
1085 Disallow Field
1086 --------------
1087
1088    The value of this field specifies a partial URL that is not to be
1089 visited. This can be a full path, or a partial path; any URL that
1090 starts with this value will not be retrieved. For example,
1091 `Disallow: /help' disallows both `/help.html' and `/help/index.html',
1092 whereas `Disallow: /help/' would disallow `/help/index.html' but allow
1093 `/help.html'.
1094
1095    Any empty value, indicates that all URLs can be retrieved. At least
1096 one Disallow field needs to be present in a record.
1097
1098 \1f
1099 File: wget.info,  Node: Norobots Examples,  Prev: Disallow Field,  Up: Robots
1100
1101 Norobots Examples
1102 -----------------
1103
1104    The following example `/robots.txt' file specifies that no robots
1105 should visit any URL starting with `/cyberworld/map/' or `/tmp/':
1106
1107      # robots.txt for http://www.site.com/
1108      
1109      User-agent: *
1110      Disallow: /cyberworld/map/ # This is an infinite virtual URL space
1111      Disallow: /tmp/ # these will soon disappear
1112
1113    This example `/robots.txt' file specifies that no robots should
1114 visit any URL starting with `/cyberworld/map/', except the robot called
1115 `cybermapper':
1116
1117      # robots.txt for http://www.site.com/
1118      
1119      User-agent: *
1120      Disallow: /cyberworld/map/ # This is an infinite virtual URL space
1121      
1122      # Cybermapper knows where to go.
1123      User-agent: cybermapper
1124      Disallow:
1125
1126    This example indicates that no robots should visit this site further:
1127
1128      # go away
1129      User-agent: *
1130      Disallow: /
1131
1132 \1f
1133 File: wget.info,  Node: Security Considerations,  Next: Contributors,  Prev: Robots,  Up: Appendices
1134
1135 Security Considerations
1136 =======================
1137
1138    When using Wget, you must be aware that it sends unencrypted
1139 passwords through the network, which may present a security problem.
1140 Here are the main issues, and some solutions.
1141
1142   1. The passwords on the command line are visible using `ps'.  If this
1143      is a problem, avoid putting passwords from the command line--e.g.
1144      you can use `.netrc' for this.
1145
1146   2. Using the insecure "basic" authentication scheme, unencrypted
1147      passwords are transmitted through the network routers and gateways.
1148
1149   3. The FTP passwords are also in no way encrypted.  There is no good
1150      solution for this at the moment.
1151
1152   4. Although the "normal" output of Wget tries to hide the passwords,
1153      debugging logs show them, in all forms.  This problem is avoided by
1154      being careful when you send debug logs (yes, even when you send
1155      them to me).
1156
1157 \1f
1158 File: wget.info,  Node: Contributors,  Prev: Security Considerations,  Up: Appendices
1159
1160 Contributors
1161 ============
1162
1163    GNU Wget was written by Hrvoje Niksic <hniksic@iskon.hr>.  However,
1164 its development could never have gone as far as it has, were it not for
1165 the help of many people, either with bug reports, feature proposals,
1166 patches, or letters saying "Thanks!".
1167
1168    Special thanks goes to the following people (no particular order):
1169
1170    * Karsten Thygesen--donated the mailing list and the initial FTP
1171      space.
1172
1173    * Shawn McHorse--bug reports and patches.
1174
1175    * Kaveh R. Ghazi--on-the-fly `ansi2knr'-ization.
1176
1177    * Gordon Matzigkeit--`.netrc' support.
1178
1179    * Zlatko Calusic, Tomislav Vujec and Drazen Kacar--feature
1180      suggestions and "philosophical" discussions.
1181
1182    * Darko Budor--initial port to Windows.
1183
1184    * Antonio Rosella--help and suggestions, plus the Italian
1185      translation.
1186
1187    * Tomislav Petrovic, Mario Mikocevic--many bug reports and
1188      suggestions.
1189
1190    * Francois Pinard--many thorough bug reports and discussions.
1191
1192    * Karl Eichwalder--lots of help with internationalization and other
1193      things.
1194
1195    * Junio Hamano--donated support for Opie and HTTP `Digest'
1196      authentication.
1197
1198    * Brian Gough--a generous donation.
1199
1200    The following people have provided patches, bug/build reports, useful
1201 suggestions, beta testing services, fan mail and all the other things
1202 that make maintenance so much fun:
1203
1204    Tim Adam, Martin Baehr, Dieter Baron, Roger Beeman and the Gurus at
1205 Cisco, Dan Berger, Mark Boyns, John Burden, Wanderlei Cavassin, Gilles
1206 Cedoc, Tim Charron, Noel Cragg, Kristijan Conkas, Andrew Deryabin,
1207 Damir Dzeko, Andrew Davison, Ulrich Drepper, Marc Duponcheel,
1208 Aleksandar Erkalovic, Andy Eskilsson, Masashi Fujita, Howard Gayle,
1209 Marcel Gerrits, Hans Grobler, Mathieu Guillaume, Dan Harkless, Heiko
1210 Herold, Karl Heuer, HIROSE Masaaki, Gregor Hoffleit, Erik Magnus
1211 Hulthen, Richard Huveneers, Simon Josefsson, Mario Juric, Goran
1212 Kezunovic, Robert Kleine, Fila Kolodny, Alexander Kourakos, Martin
1213 Kraemer, Simos KSenitellis, Hrvoje Lacko, Daniel S. Lewart, Dave Love,
1214 Jordan Mendelson, Lin Zhe Min, Charlie Negyesi, Andrew Pollock, Steve
1215 Pothier, Jan Prikryl, Marin Purgar, Keith Refson, Tobias Ringstrom,
1216 Juan Jose Rodrigues, Edward J. Sabol, Heinz Salzmann, Robert Schmidt,
1217 Toomas Soome, Tage Stabell-Kulo, Sven Sternberger, Markus Strasser,
1218 Szakacsits Szabolcs, Mike Thomas, Russell Vincent, Charles G Waldman,
1219 Douglas E. Wegscheid, Jasmin Zainul, Bojan Zdrnja, Kristijan Zimmer.
1220
1221    Apologies to all who I accidentally left out, and many thanks to all
1222 the subscribers of the Wget mailing list.
1223