DO NOT REPLY [Bug 4768] problem sync big filesystem over slow connection

Jamie Lokier jamie at shareable.org
Fri Jul 13 20:17:20 GMT 2007


samba-bugs at samba.org wrote:
> (In reply to comment #4)
> > i can't find the option --no-tweak-hlinked in rsync.
> 
> That's because there is no such option in rsync.  It's a proposed patch.  It's
> also not needed if you use --ignore-existing, as I suggested.
> 
> I'm not planning to add the option you propose.

There's a problem with --ignore-existing in this context.

If you are making multiple snapshots of a directory (as prompted this
little discussion), often they are backups of some kind, and that
means you often want the snapshots to preserve the hard-link structure
of the source directory.

I.e. you'll want to use --ignore-existing with -H.

But that doesn't work very usefully:

    mkdir source
    touch source/1
    ln source/1 source/2

Let's make a copy:

    mkdir backup
    rsync -avH --ignore-existing source/ backup/

But simulate as if it was aborted before finishing:

    rm backup/2

Now let's redo the copy, to finish.  Using --ignore-existing as suggested:

    rsync -avH --ignore-existing source/ backup/

Check:

    ls -l backup
    >>> total 0
    >>> -rw-r--r-- 1 jamie jamie 0 2007-07-13 21:07 1

Oh dear!  It doesn't copy a/2.

This is logical but it's not useful for this operation.

Thus --ignore-existing is not suitable for finishing previously
aborted copies when you use -H, whether it's to save space or preserve
structure.  And not using -H makes those backups much less like backups.

-- Jamie


More information about the rsync mailing list