Dan LeGate <[EMAIL PROTECTED]> writes:

> What I'm wanting to do is Mirror a site, but keep backups of any
> local files that get replaced because newer versions are being
> downloaded.

You might want to try the undocumented option `--backups', which does
what you want, i.e. forces the use of numbered backups.

Hmm.  Why is that option undocumented?  It seems useful in this case,
and, as far as I can tell, it works correctly.

> Upon reading the documentation again, I think I originally
> misunderstood the file.1, file.2 renaming scheme.
>
> I *thought* what happened was if a newer file exists on the remote
> server, the local copy would first be renamed to file.1 and the
> newer copy would be downloaded in its place.

That's what happens when you use `--backups'.  Normally, the local
copy is overwritten by the new copy.

> Instead, it looks like the newer copy gets pulled down as file.1 and
> then file.2, if I'm reading the following from the documentation
> correctly:

Umm, no.  -N turns off the numbered backups, which means that the file
is either not downloaded or is overwritten, depending on whether the
local file is older than the remote file or not.

>    "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."

"Without -N" is the key phrase.

> I was hoping for this to be the local copy being renamed and the
> newer file taking its place.  Am I reading this right?

You're not, but `--backups' does seem to do what you want.  Let us
know if it works for you.

Reply via email to