I was struggling tracking down a strange behaviour and could reproduce it
with the testsuite. After patching it with:
--- a/testsuite/compare-dest.test 2007-09-03 22:43:58.000000000 +0200
+++ b/testsuite/compare-dest.test 2014-12-30 19:28:32.060267390 +0100
@@ -18,6 +18,7 @@
# Setup the alt and chk dirs
$RSYNC -av --include=text --include='*/' --exclude='*'
"$fromdir/" "$alt1dir/"
+stat -c %y "$fromdir/text" "$alt1dir/text"
$RSYNC -av --include=etc-ltr-list --include='*/' --exclude='*'
"$fromdir/" "$alt2dir/"
sleep 1
@@ -34,4 +35,4 @@
'$fromdir/' '$todir/'" "$fromdir"
"$todir"
# The script would have aborted on error, so getting here means we've won.
-exit 0
+exit 99
in order to examine and preserve the data, I found:
2014-12-30 19:29:01.806934641 +0100
2014-12-30 19:29:01.820267972 +0100
in the test.log, e.g. the created file's mtime differs!
Surprisingly, the same command did work when calling it from the command line
after changing to the data directory:
# cd testtmp/compare-dest
# /tmp/rsync-3.1.1/rsync -av --include=text --include='*/'
--exclude='*' /tmp/rsync-3.1.1/testtmp/compare-dest/from/
/tmp/rsync-3.1.1/testtmp/compare-dest/alt3/
# stat -c %y /tmp/rsync-3.1.1/testtmp/compare-dest/from/text
/tmp/rsync-3.1.1/testtmp/compare-dest/alt3/text
2014-12-30 19:29:01.806934641 +0100
2014-12-30 19:29:01.806934641 +0100
Correct mtime (as it should be).
Is there any reasonable explanation for this?!
I was using Knoppix 7.4.1 (Kernel 3.16.2) on a mounted ext4 filesystem.
Ingo