Thanks for taking the time to write this up. However, I think you've
missed a particular detail that explain why rsync is behaving the way it
is.

Basically, there is a fundamental difference between "rsync foo bar" and
"rsync foo/ bar/", which is described under the "USAGE" section of the
man page. The first form, which you used in your initial example, will
synchronise a file or folder called "foo" _into_ a folder called "bar".
In other words, "foo" is copied to "bar/foo". In the case of your
example, therefore, the files that were cp'd into bar are not the files
being compared, and so rsync needs to copy them.

However the second form, with the trailing slash on the source folder,
means to synchronise the files in a folder called "foo" with the files
in a folder called "bar", so now it's comparing foo/a with bar/a, etc,
which is probably what you wanted. The reason it's seeing differences
now is that your initial "cp" was not set to preserve timestamps (you'd
need "cp -p" or similar), so again rsync thinks they're different and
needs to copy the files.

Finally, why does it copy the files instead of using the checksum
comparison? This is described in the man page under the option "-W,
--whole-file": when source and destination are both local, it doesn't
bother with the checksum comparison as it's less effort.

** Changed in: rsync (Ubuntu)
       Status: New => Invalid

-- 
Very serious bug: rsync transmits identical files when it should not
https://bugs.launchpad.net/bugs/501730
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to