Database file rsync - any way to tell it to rsync against the last file?

Wayne Davison wayned at
Sat Nov 13 18:53:34 GMT 2004

On Fri, Nov 12, 2004 at 03:27:57PM -0600, Michael Bourgon wrote:
> Is there any way to tell it that I want to rsync mike_db_20041110.bak,
> using mike_db_20041109.bak as a source, so that when I'm done I still
> have both files?

One solution that rsync supports out of the box is to use custom named
directories with the same file name.  For instance, change the files to
be these:


You could then run an rsync command like this:

  rsync -av --link-dest=/path/20041109 20041110/ remote:/path/20041110/

(The repeated 20041110 dir is necessary to make the lookup in the link-
dest dir work right.)

There is also a diff in the patches dir named fuzzy.diff that lets you
specify the --fuzzy option when you want rsync to try to find a matching
basis file in the current directory (it must have the same suffix and be
named similarly to the transferred file).  Using an rsync modified with
that patch would work with the filenames you're currently using.  I'm
considering adding --fuzzy for the next release, but I'd like to see it
improved a bit first.


More information about the rsync mailing list