[Bug 1479] --compare-dest suppresses output file if same timestamp present

samba-bugs at samba.org samba-bugs at samba.org
Sat Jun 26 02:20:57 GMT 2004


wayned at samba.org changed:

           What    |Removed                     |Added
             Status|NEW                         |ASSIGNED

------- Additional Comments From wayned at samba.org  2004-06-25 19:12 -------
Yes, it certainly can seem counter intuitive that the files that match in the
compare-dest dir don't get copied into the real destination directory.

A better solution than messing up the timestamps in the compare-dest dir is to
just specify the -I option (which turns off the size+time quick check, causing
all the files to be updated, and the unchanged files will get copied from the
compare-dest dir).  It does cause all the matching files to get read on both
machines, though, which could be optimized a little if you are willing to do
some scripting.

For instance, if the amount of changed data is not large, you could first copy
the compare-dest dir to the new destionation and then rsync the data from the
remote system without using compare-dest.  This saves the remote read, but is
not optimal if lots of files were changed.

Another potentially workable solution is to start with the same compare-dest
copy that you're doing now, and follow it with an rsync of the compare-dest dir
to the new destination dir using the --update (-u) option.  As long as you know
that the changed files will have more recent timestamps than the older files in
the compare-dest dir, all the files in the new destination dir will be left
alone.  If that is too risky for you, you could make a note of all the files
that get transferred in the first rsync (i.e. use -v and filter the output into
a file list) and then use that file list as an exclusion list for the extra copy
(input it it into --exclude-from).

I'll also accept this request for an enhancement.  If rsync had either the
--copy-dest option you suggest or an --exclude-existing option this would be
easier to do.

Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the rsync mailing list