| www.delorie.com/gnu/docs/wget/wget_7.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
bind() to ADDRESS on
the local machine. ADDRESS may be specified as a hostname or IP
address. This option can be useful if your machine is bound to multiple
IPs.
When running Wget without `-N', `-nc', or `-r',
downloading the same file in the same directory will result in the
original copy of file being preserved and the second copy being
named `file.1'. If that file is downloaded yet again, the
third copy will be named `file.2', and so on. When
`-nc' is specified, this behavior is suppressed, and Wget will
refuse to download newer copies of `file'. Therefore,
"no-clobber" is actually a misnomer in this mode--it's not
clobbering that's prevented (as the numeric suffixes were already
preventing clobbering), but rather the multiple version saving that's
prevented.
When running Wget with `-r', but without `-N' or `-nc', re-downloading a file will result in the new copy simply overwriting the old. Adding `-nc' will prevent this behavior, instead causing the original version to be preserved and any newer copies on the server to be ignored.
When running Wget with `-N', with or without `-r', the decision as to whether or not to download a newer copy of a file depends on the local and remote timestamp and size of the file (see section 5. Time-Stamping). `-nc' may not be specified at the same time as `-N'.
Note that when `-nc' is specified, files with the suffixes `.html' or (yuck) `.htm' will be loaded from the local disk and parsed as if they had been retrieved from the Web.
wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z |
If there is a file named `ls-lR.Z' in the current directory, Wget will assume that it is the first portion of the remote file, and will ask the server to continue the retrieval from an offset equal to the length of the local file.
Note that you don't need to specify this option if you just want the current invocation of Wget to retry downloading a file should the connection be lost midway through. This is the default behavior. `-c' only affects resumption of downloads started prior to this invocation of Wget, and whose local files are still sitting around.
Without `-c', the previous example would just download the remote file to `ls-lR.Z.1', leaving the truncated `ls-lR.Z' file alone.
Beginning with Wget 1.7, if you use `-c' on a non-empty file, and it turns out that the server does not support continued downloading, Wget will refuse to start the download from scratch, which would effectively ruin existing contents. If you really want the download to start from scratch, remove the file.
Also beginning with Wget 1.7, if you use `-c' on a file which is of equal size as the one on the server, Wget will refuse to download the file and print an explanatory message. The same happens when the file is smaller on the server than locally (presumably because it was changed on the server since your last download attempt)---because "continuing" is not meaningful, no download occurs.
On the other side of the coin, while using `-c', any file that's
bigger on the server than locally will be considered an incomplete
download and only (length(remote) - length(local)) bytes will be
downloaded and tacked onto the end of the local file. This behavior can
be desirable in certain cases--for instance, you can use `wget -c'
to download just the new portion that's been appended to a data
collection or log file.
However, if the file is bigger on the server because it's been changed, as opposed to just appended to, you'll end up with a garbled file. Wget has no way of verifying that the local file is really a valid prefix of the remote file. You need to be especially careful of this when using `-c' in conjunction with `-r', since every file will be considered as an "incomplete download" candidate.
Another instance where you'll get a garbled file if you try to use `-c' is if you have a lame HTTP proxy that inserts a "transfer interrupted" string into the local file. In the future a "rollback" option may be added to deal with this case.
Note that `-c' only works with FTP servers and with HTTP
servers that support the Range header.
The "bar" indicator is used by default. It draws an ASCII progress bar graphics (a.k.a "thermometer" display) indicating the status of retrieval. If the output is not a TTY, the "dot" bar will be used by default.
Use `--progress=dot' to switch to the "dot" display. It traces the retrieval by printing dots on the screen, each dot representing a fixed amount of downloaded data.
When using the dotted retrieval, you may also set the style by
specifying the type as `dot:style'. Different styles assign
different meaning to one dot. With the default style each dot
represents 1K, there are ten dots in a cluster and 50 dots in a line.
The binary style has a more "computer"-like orientation--8K
dots, 16-dots clusters and 48 dots per line (which makes for 384K
lines). The mega style is suitable for downloading very large
files--each dot represents 64K retrieved, there are eight dots in a
cluster, and 48 dots on each line (so each line contains 3M).
Note that you can set the default style using the progress
command in `.wgetrc'. That setting may be overridden from the
command 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 `--progress=bar:force'.
wget --spider --force-html -i bookmarks.html |
This feature needs much more work for Wget to get close to the functionality of real WWW spiders.
Please do not lower the default timeout value with this option unless you know what you are doing.
Note that Wget implementeds the limiting by sleeping the appropriate amount of time after a network read that took less time than specified by the rate. Eventually this strategy causes the TCP transfer to slow down to approximately the specified rate. However, it takes some time for this balance to be achieved, so don't be surprised if limiting the rate doesn't work with very small files. Also, the "sleeping" strategy will misfire when an extremely small bandwidth, say less than 1.5KB/s, is specified.
m suffix, in hours using h
suffix, or in days using d suffix.
Specifying a large value for this option is useful if the network or the destination host is down, so that Wget can wait long enough to reasonably expect the network error to be fixed before the retry.
Note that this option is turned on by default in the global `wgetrc' file.
A recent article in a publication devoted to development on a popular consumer platform provided code to perform this analysis on the fly. Its author suggested blocking at the class C address level to ensure automated retrieval programs were blocked despite changing DHCP-supplied addresses.
The `--random-wait' option was inspired by this ill-advised recommendation to block many unrelated users from a web site due to the actions of one.
Note that quota will never affect downloading a single file. So if you specify `wget -Q10k ftp://wuarchive.wustl.edu/ls-lR.gz', all of the `ls-lR.gz' will be downloaded. The same goes even when several URLs are specified on the command-line. However, quota is respected when retrieving either recursively, or from an input file. Thus you may safely type `wget -Q2m -i sites'---download will be aborted when the quota is exceeded.
Setting quota to 0 or to `inf' unlimits the download quota.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |