Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm doing some synching with rsync using:

rsync --rLvv --times --size-only 

For my initial sync. My idea, now is to use:

rsync --rLvv --times

To synch files that have a new modified time. My problem is that after the initial rsync, I see the following Modified times on the files that have been synced:

remote$ stat 6080_04_big.mp4
  File: `6080_04_big.mp4'
  Size: 258788267       Blocks: 505448     IO Block: 4096   regular file
Device: 903h/2307d      Inode: 862897      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 2000/ht)   Gid: ( 2000/    cust)
Access: 2010-08-13 10:46:20.000000000 -0700
Modify: 2010-08-12 17:55:08.000000000 -0700
Change: 2010-08-13 10:46:20.205721673 -0700
local$ stat 6080_04_big.mp4
  File: `6080_04_big.mp4'
  Size: 258788267       Blocks: 505448     IO Block: 4096   regular file
Device: 902h/2306d      Inode: 136015      Links: 1
Access: (0664/-rw-rw-r--)  Uid: (  506/   admin)   Gid: (  506/   admin)
Access: 2010-08-12 20:55:01.482104000 -0400
Modify: 2010-08-12 20:55:08.468122000 -0400
Change: 2010-08-12 21:15:06.952810711 -0400

The modify time is 'effectively' the same, but only down to the second. What's the resolution of the comparison here? It seems that anything that is the same up to the second is considered the same, but I can't find any docs specifying this. Anyone know off the top of their heads?

share|improve this question
up vote 5 down vote accepted

Here's me answering my own question:

rsync uses the utime() call which sets the modification time of a file down to 1 second resolution. So, effectively, files that are the same up to the second, are considered the same for the time comparison piece of rsync's checks.

share|improve this answer
No... i didn't already know the answer... I just decided to start digging into the source, since I couldn't find this specified in the docs. – gabe. Aug 13 '10 at 19:25
Bonus points for source-sleuthing. – Eli Frey Aug 13 '10 at 20:02
Caveat: if the files are stored on FAT filesystems, the resolution is 2 seconds (a limitation of the filesystem). Use --modify-window=1 to avoid odd behavior, which allows for the 2 second discrepancy. – jmanning2k Aug 17 '10 at 20:05
good call... that could definitely cause a problem. – gabe. Aug 17 '10 at 22:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.