This is the mail archive of the
cygwin
mailing list for the Cygwin project.
[RSYNC] bad modify/change time set by rsync ?
- From: LEGOND Fabrice <fabrice dot legond at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 06 Jan 2015 20:03:21 +0100
- Subject: [RSYNC] bad modify/change time set by rsync ?
- Authentication-results: sourceware.org; auth=none
Hi,
I use cygwin for a long time now. And I often use rsync to do
incremental backup and mirroring of data.
I noted several times in the past that rsync keeps copying some NOT
MODIFIED files (always the same ones) again and again whereas it was
working correctly for the vast majority of the remaining files. I see
this problem for a long time ie on the cygwin 1.6/1.7 32 and 64 bit
versions. It is difficult to reproduce the bug because I don't know what
causing it.
It can happen between remote (linux ssh - ext3/reiserfs/ext4 partitions)
source and a target local NTFS, a remote source and a target local
exFat, between 2 local ntfs partitions and between a local NTFS and a
local target exFat (which has no right management).
I have tried check permissions (because it was the most evident culprit
to me) and tried to test many options combination of rsync (-X, -g,
-no-g, -o, -no-o, -no-p, -p, -a, -t) and read numerous threads, but no
luck here. Then, I checked the time and, rarely, on some files, the
rsync does not seem to be able to correctly set the modify and change time of
the target file.
This problem is reproducible as soon as you have a bad file (but very
few are): it will always be resynchronized whatever rsync options you
set (even with/out -t/-a).
Here an example of "malicious" file after a synchronization (with/out
different combinations of -g -no-g -no-o -no-p -p -o, with/out some
other obscure options, even after removing the target and its parents
directory, but always with -t ...).
stat of the source file (ntfs):
File:
'/cygdrive/e/Dev_Gen/android/apps/apk/Adobe_Flash_Player_10.1.120.1.apk'
Size: 4544329 Blocks: 4480 IO Block: 65536 regular file
Device: 54275946h/1411864902d Inode: 2002648394446585555 Links: 1
Access: (0600/-rw-------) Uid: ( 1001/ xxx) Gid: ( 513/ Aucun)
Access: 2014-11-05 22:18:30.000000000 +0100
Modify: 2014-05-19 14:52:43.000000000 +0200
Change: 2014-05-19 14:52:43.000000000 +0200
Birth: 2014-06-14 17:28:05.870000000 +0200
stat of the destination file (exfat):
File:
'/cygdrive/f/backup_data/Dev_Gen/android/apps/apk/Adobe_Flash_Player_10.1.120.1.apk'
Size: 4544329 Blocks: 4608 IO Block: 65536 regular file
Device: e65d19c0h/3864861120d Inode: 2344130775972094377 Links: 1
Access: (0600/-rw-------) Uid: ( 1001/ xxx) Gid: ( 513/ Aucun)
Access: 2015-01-06 16:59:00.000000000 +0100
Modify: 2014-05-19 14:52:44.000000000 +0200
Change: 2014-05-19 14:52:44.000000000 +0200
Birth: 2014-10-26 14:37:20.570000000 +0100
You can see here that:
* the Modify/Change time differ from one second. Why ?
* The Birth time value of the target file is impossible for me to
understand but should not have any side-effect. However, is it a problem
with cygwin ?
* blocks should be irrelevant here because it can differ from FS to FS.
Even after deleting the target, you get the same Modify/Change/Birth but
the access time differ as the target file contains the (effective) date
of the copy.
On another "not malicious" file, you can see what seem the correct time
in the two files.
stat of the source file (ntfs):
File:
'/cygdrive/e/Dev_Gen/android/apps/apk/Adobe_Flash_Player_11.1.115.81.apk'
Size: 4708736 Blocks: 4608 IO Block: 65536 regular file
Device: 54275946h/1411864902d Inode: 14702358681444365420 Links: 1
Access: (0600/-rw-------) Uid: ( 1001/ xxx) Gid: ( 513/ Aucun)
Access: 2014-11-05 22:18:30.000000000 +0100
Modify: 2014-05-19 14:53:46.000000000 +0200
Change: 2014-05-19 14:53:46.000000000 +0200
Birth: 2014-06-14 17:28:06.960000000 +0200
stat of the destination file (exfat):
File:
'/cygdrive/f/backup_data/Dev_Gen/android/apps/apk/Adobe_Flash_Player_11.1.115.81.apk'
Size: 4708736 Blocks: 4608 IO Block: 65536 regular file
Device: e65d19c0h/3864861120d Inode: 2811054816192366358 Links: 1
Access: (0600/-rw-------) Uid: ( 1001/ xxx) Gid: ( 513/ Aucun)
Access: 2015-01-06 16:59:02.000000000 +0100
Modify: 2014-05-19 14:53:46.000000000 +0200
Change: 2014-05-19 14:53:46.000000000 +0200
Birth: 2014-10-26 14:37:22.640000000 +0100
Just to be clear, I also have numerous "not malicious" files with a
different blocks size value.
To conclude, AFTER 'touch'ing the source file (ie to the current time),
the always copy behavior of rsync stop after one rsync as it should be.
I really don't know if this is a cygwin problem (which can not correctly
convert time from FS to FS, or a buggy setting function) or an internal
rsync problem or a bad interaction between the two (most likely probable
to me, rounding time ?).
Or perhaps I miss something; If someone can help me.
regards,
fabrice
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple