[Live-demo] Re: Use of "wget -c"

Hamish hamish_b at yahoo.com
Wed Sep 9 14:44:53 PDT 2009


Cameron wrote:
> I notice that you have used "wget -c" and "wget -r" in different
> places in the install scripts.

Right, this is intentional.

-c to continue aborted download instead of starting over as file.1,
file.2, file.3, etc.  This has been used for large downloads (10s of MB)
which are not expected to change. i.e. versioned sample datasets. This
is not safe for files which may change on the server, it simply compares
the number of bytes to decide if it has the whole file. If the file is
already downloaded wget will say that and then exit with a EXIT_SUCCESS
exit status.


-r is really for recursive mode, but when used on a single file it will
replace the existing one. This is also to help the scripts be a bit more
robust to the"file.1" vs. "file" problem, especially for files downloaded
directly into the filesystem & not the build dir.

I've used this for downloading patches and other small text files which
may change with time. When -r is used in this way --output-document= or
-O must be used as well, otherwise the recursive side of it tries to
reconstruct the dir structure. Maybe a "rm" before the wget could ensure
that the downloaded version is fresh without needing -r. Shrug.


Finally for trivial downloads I don't expect to change (icons) I used
"wget -nv" which is non-verbose mode. Using that for a long download
could give the impression things have stalled, ^C, then file.1, file.2,
cruft. "wget --quiet" masks error messages so is to be avoided.


I think wget already checks if stdout is a tty before deciding to use
=====>  vs.  |.....|.....|.... style progress meters. (ie logfile friendly)
Otherwise you could switch that on by hand as well.

 
> Should we go through the scripts and convert all "wget" to "wget -c" ?

I don't think so; one size doesn't fit all..

as long as everyone builds and downloads to /tmp/ dirs and cleans up
every time, the flags will be mostly redundant overkill.

I'm happy with ad hoc and folks using or not using those flags as they
see fit.


regards,
Hamish



      



More information about the Osgeolive mailing list