?? wget.texi
字號:
``rollback'' option may be added to deal with this case.Note that @samp{-c} only works with @sc{ftp} servers and with @sc{http}servers that support the @code{Range} header.@cindex progress indicator@cindex dot style@item --progress=@var{type}Select the type of the progress indicator you wish to use. Legalindicators are ``dot'' and ``bar''.The ``bar'' indicator is used by default. It draws an @sc{ascii} progressbar graphics (a.k.a ``thermometer'' display) indicating the status ofretrieval. If the output is not a TTY, the ``dot'' bar will be used bydefault.Use @samp{--progress=dot} to switch to the ``dot'' display. It tracesthe retrieval by printing dots on the screen, each dot representing afixed amount of downloaded data.When using the dotted retrieval, you may also set the @dfn{style} byspecifying the type as @samp{dot:@var{style}}. Different styles assigndifferent meaning to one dot. With the @code{default} style each dotrepresents 1K, there are ten dots in a cluster and 50 dots in a line.The @code{binary} style has a more ``computer''-like orientation---8Kdots, 16-dots clusters and 48 dots per line (which makes for 384Klines). The @code{mega} style is suitable for downloading very largefiles---each dot represents 64K retrieved, there are eight dots in acluster, and 48 dots on each line (so each line contains 3M).Note that you can set the default style using the @code{progress}command in @file{.wgetrc}. That setting may be overridden from thecommand line. The exception is that, when the output is not a TTY, the``dot'' progress will be favored over ``bar''. To force the bar output,use @samp{--progress=bar:force}.@item -N@itemx --timestampingTurn on time-stamping. @xref{Time-Stamping}, for details.@cindex server response, print@item -S@itemx --server-responsePrint the headers sent by @sc{http} servers and responses sent by@sc{ftp} servers.@cindex Wget as spider@cindex spider@item --spiderWhen invoked with this option, Wget will behave as a Web @dfn{spider},which means that it will not download the pages, just check that theyare there. For example, you can use Wget to check your bookmarks:@examplewget --spider --force-html -i bookmarks.html@end exampleThis feature needs much more work for Wget to get close to thefunctionality of real web spiders.@cindex timeout@item -T seconds@itemx --timeout=@var{seconds}Set the network timeout to @var{seconds} seconds. This is equivalentto specifying @samp{--dns-timeout}, @samp{--connect-timeout}, and@samp{--read-timeout}, all at the same time.When interacting with the network, Wget can check for timeout andabort the operation if it takes too long. This prevents anomalieslike hanging reads and infinite connects. The only timeout enabled bydefault is a 900-second read timeout. Setting a timeout to 0 disablesit altogether. Unless you know what you are doing, it is best not tochange the default timeout settings.All timeout-related options accept decimal values, as well assubsecond values. For example, @samp{0.1} seconds is a legal (thoughunwise) choice of timeout. Subsecond timeouts are useful for checkingserver response times or for testing network latency.@cindex DNS timeout@cindex timeout, DNS@item --dns-timeout=@var{seconds}Set the DNS lookup timeout to @var{seconds} seconds. DNS lookups thatdon't complete within the specified time will fail. By default, thereis no timeout on DNS lookups, other than that implemented by systemlibraries.@cindex connect timeout@cindex timeout, connect@item --connect-timeout=@var{seconds}Set the connect timeout to @var{seconds} seconds. TCP connections thattake longer to establish will be aborted. By default, there is noconnect timeout, other than that implemented by system libraries.@cindex read timeout@cindex timeout, read@item --read-timeout=@var{seconds}Set the read (and write) timeout to @var{seconds} seconds. The``time'' of this timeout refers to @dfn{idle time}: if, at any point inthe download, no data is received for more than the specified numberof seconds, reading fails and the download is restarted. This optiondoes not directly affect the duration of the entire download.Of course, the remote server may choose to terminate the connectionsooner than this option requires. The default read timeout is 900seconds.@cindex bandwidth, limit@cindex rate, limit@cindex limit bandwidth@item --limit-rate=@var{amount}Limit the download speed to @var{amount} bytes per second. Amount maybe expressed in bytes, kilobytes with the @samp{k} suffix, or megabyteswith the @samp{m} suffix. For example, @samp{--limit-rate=20k} willlimit the retrieval rate to 20KB/s. This is useful when, for whateverreason, you don't want Wget to consume the entire available bandwidth.This option allows the use of decimal numbers, usually in conjunctionwith power suffixes; for example, @samp{--limit-rate=2.5k} is a legalvalue.Note that Wget implements the limiting by sleeping the appropriateamount of time after a network read that took less time than specifiedby the rate. Eventually this strategy causes the TCP transfer to slowdown to approximately the specified rate. However, it may take sometime for this balance to be achieved, so don't be surprised if limitingthe rate doesn't work well with very small files.@cindex pause@cindex wait@item -w @var{seconds}@itemx --wait=@var{seconds}Wait the specified number of seconds between the retrievals. Use ofthis option is recommended, as it lightens the server load by making therequests less frequent. Instead of in seconds, the time can bespecified in minutes using the @code{m} suffix, in hours using @code{h}suffix, or in days using @codeeaqy2mk suffix.Specifying a large value for this option is useful if the network or thedestination host is down, so that Wget can wait long enough toreasonably expect the network error to be fixed before the retry. Thewaiting interval specified by this function is influenced by@code{--random-wait}, which see.@cindex retries, waiting between@cindex waiting between retries@item --waitretry=@var{seconds}If you don't want Wget to wait between @emph{every} retrieval, but onlybetween retries of failed downloads, you can use this option. Wget willuse @dfn{linear backoff}, waiting 1 second after the first failure on agiven file, then waiting 2 seconds after the second failure on thatfile, up to the maximum number of @var{seconds} you specify. Therefore,a value of 10 will actually make Wget wait up to (1 + 2 + ... + 10) = 55seconds per file.Note that this option is turned on by default in the global@file{wgetrc} file.@cindex wait, random@cindex random wait@item --random-waitSome web sites may perform log analysis to identify retrieval programssuch as Wget by looking for statistically significant similarities inthe time between requests. This option causes the time between requeststo vary between 0.5 and 1.5 * @var{wait} seconds, where @var{wait} wasspecified using the @samp{--wait} option, in order to mask Wget'spresence from such analysis.A 2001 article in a publication devoted to development on a popularconsumer platform provided code to perform this analysis on the fly.Its author suggested blocking at the class C address level to ensureautomated retrieval programs were blocked despite changing DHCP-suppliedaddresses.The @samp{--random-wait} option was inspired by this ill-advisedrecommendation to block many unrelated users from a web site due to theactions of one.@cindex proxy@itemx --no-proxyDon't use proxies, even if the appropriate @code{*_proxy} environmentvariable is defined.@c man endFor more information about the use of proxies with Wget, @xref{Proxies}.@c man begin OPTIONS@cindex quota@item -Q @var{quota}@itemx --quota=@var{quota}Specify download quota for automatic retrievals. The value can bespecified in bytes (default), kilobytes (with @samp{k} suffix), ormegabytes (with @samp{m} suffix).Note that quota will never affect downloading a single file. So if youspecify @samp{wget -Q10k ftp://wuarchive.wustl.edu/ls-lR.gz}, all of the@file{ls-lR.gz} will be downloaded. The same goes even when several@sc{url}s are specified on the command-line. However, quota isrespected when retrieving either recursively, or from an input file.Thus you may safely type @samp{wget -Q2m -i sites}---download will beaborted when the quota is exceeded.Setting quota to 0 or to @samp{inf} unlimits the download quota.@cindex DNS cache@cindex caching of DNS lookups@item --no-dns-cacheTurn off caching of DNS lookups. Normally, Wget remembers the IPaddresses it looked up from DNS so it doesn't have to repeatedlycontact the DNS server for the same (typically small) set of hosts itretrieves from. This cache exists in memory only; a new Wget run willcontact DNS again.However, it has been reported that in some situations it is notdesirable to cache host names, even for the duration of ashort-running application like Wget. With this option Wget issues anew DNS lookup (more precisely, a new call to @code{gethostbyname} or@code{getaddrinfo}) each time it makes a new connection. Please notethat this option will @emph{not} affect caching that might beperformed by the resolving library or by an external caching layer,such as NSCD.If you don't understand exactly what this option does, you probablywon't need it.@cindex file names, restrict@cindex Windows file names@item --restrict-file-names=@var{mode}Change which characters found in remote URLs may show up in local filenames generated from those URLs. Characters that are @dfn{restricted}by this option are escaped, i.e. replaced with @samp{%HH}, where@samp{HH} is the hexadecimal number that corresponds to the restrictedcharacter.By default, Wget escapes the characters that are not valid as part offile names on your operating system, as well as control characters thatare typically unprintable. This option is useful for changing thesedefaults, either because you are downloading to a non-native partition,or because you want to disable escaping of the control characters.When mode is set to ``unix'', Wget escapes the character @samp{/} andthe control characters in the ranges 0--31 and 128--159. This is thedefault on Unix-like OS'es.When mode is set to ``windows'', Wget escapes the characters @samp{\},@samp{|}, @samp{/}, @samp{:}, @samp{?}, @samp{"}, @samp{*}, @samp{<},@samp{>}, and the control characters in the ranges 0--31 and 128--159.In addition to this, Wget in Windows mode uses @samp{+} instead of@samp{:} to separate host and port in local file names, and uses@samp{@@} instead of @samp{?} to separate the query portion of the filename from the rest. Therefore, a URL that would be saved as@samp{www.xemacs.org:4300/search.pl?input=blah} in Unix mode would besaved as @samp{www.xemacs.org+4300/search.pl@@input=blah} in Windowsmode. This mode is the default on Windows.If you append @samp{,nocontrol} to the mode, as in@samp{unix,nocontrol}, escaping of the control characters is alsoswitched off. You can use @samp{--restrict-file-names=nocontrol} toturn off escaping of control characters without affecting the choice ofthe OS to use as file name restriction mode.@cindex IPv6@itemx -4@itemx --inet4-only@itemx -6@itemx --inet6-onlyForce connecting to IPv4 or IPv6 addresses. With @samp{--inet4-only}or @samp{-4}, Wget will only connect to IPv4 hosts, ignoring AAAArecords in DNS, and refusing to connect to IPv6 addresses specified inURLs. Conversely, with @samp{--inet6-only} or @samp{-6}, Wget willonly connect to IPv6 hosts and ignore A records and IPv4 addresses.Neither options should be needed normally. By default, an IPv6-awareWget will use the address family specified by the host's DNS record.If the DNS responds with both IPv4 and IPv6 addresses, Wget will trythem in sequence until it finds one it can connect to. (Also see@code{--prefer-family} option described below.)These options can be used to deliberately force the use of IPv4 orIPv6 address families on dual family systems, usually to aid debuggingor to deal with broken network configuration. Only one of@samp{--inet6-only} and @samp{--inet4-only} may be specified at thesame time. Neither option is available in Wget compiled without IPv6support.@item --prefer-family=IPv4/IPv6/noneWhen given a choice of several addresses, connect to the addresseswith specified address family first. IPv4 addresses are preferred bydefault.This avoids spurious errors and connect attempts when accessing hoststhat resolve to both IPv6 and IPv4 addresses from IPv4 networks. Forexample, @samp{www.kame.net} resolves to@samp{2001:200:0:8002:203:47ff:fea5:3085} and to@samp{203.178.141.194}. When the preferred family is @code{IPv4}, theIPv4 address is used first; when the preferred family is @code{IPv6},the IPv6 address is used first; if the specified value is @code{none},the address order returned by DNS is used without change.Unlike @samp{-4} and @samp{-6}, this option doesn't inhibit access toany address family, it only changes the @emph{order} in which theaddresses are accessed. Also note that the reordering performed bythis option is @dfn{stable}---it doesn't affect order of addresses ofthe same family. That is, the relative order of all IPv4 addressesand of all IPv6 addresses remains intact in all cases.@item --retry-connrefusedConsider ``connection refused'' a transient error and try again.Normally Wget gives up on a URL when it is unable to connect to thesite because failure to connect is taken as a sign that the server isnot running at all and that retries would not help. This option isfor mirroring unreliable sites whose servers tend to disappear forshort periods of time.@cindex user@cindex password@cindex authentication@item --user=@var{user}@itemx --password=@var{password}Specify the username @var{user} and password @var{password} for both@sc{ftp} and @sc{http} file retrieval. These parameters can be overriddenusing the @samp{--ftp-user} and @samp{--ftp-password} options for @sc{ftp} connections and the @samp{--http-user} and @samp{--http-password} options for @sc{http} connections.@end table@node Directory Options
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -