two quick conceptual questions RE: rsync (and rsyncing snapshots)

Chuck Swiger cswiger at
Tue Nov 1 13:38:46 PST 2005

user wrote:
> Chuck - thank you...


> On Tue, 1 Nov 2005, Chuck Swiger wrote: 
>> rsync complains when the filesystem changes underneath it, but it will continue 
>> to run.  On the other hand, rsync is not going to safely maintain the 
>> referential integrity of a complex file like a live database, but it's okay for 
>> most other things including mbox's.
> Does it simply complain, or does that somehow alter (lessen) the integrity
> of the sync that is going on ?

The files which it notices are either copied or noticed as being missing.  Any 
new files which get created after rsync does it's first scan are not going to 
be picked up later on by rsync.

>> rsync'ing a snapshot is a fine idea.
> Ok - because _nothing_ would change, and thus rsync would not complain,
> etc.  My gut is that while rsync performance might be increased,
> filesystem performance would be about the same, since all destructions and
> changes on the underlying filesystem are still being committed to the
> snapshot ... can you think of a reason why this would not only increase
> the rsync performance, but the overall FS performance while rsyncing ?

No.  The point of using snapshots is to address the integrity concern above, 
they don't do anything in particular to change the performance.  If disk I/O is 
a significant concern to you, add more spindles, use RAID-1 or RAID-10 
configurations, or some combination of the two.

>>>Finally, am I correct that there are _only two_ rsync comparison methods -
>>>the default checksum method, and the --size-only method ?  Am I correct
>>>that rsync _always_ looks at the timestamp first, and then applies either
>>>checksum or size comparison ONLY IF the timestamps are different ?
>> No, rsync checks both timestamp and size or checksum.
> So you are saying even if the timestamps are identical, rsync will _still_
> do either a size or checksum comparison ?  That seems ... inefficient
> ?  Is there a way to tell it "if the timestamps are identical, just move
> on" ?

What happens if a program appends some more data during the same second?  rsync 
has to fstat() the file anyway which potentially involves a disk operation, 
once it's done so, comparing both timestamp and size doesn't take a significant 
amount longer to do.

  -c, --checksum              skip based on checksum, not mod-time & size


More information about the freebsd-questions mailing list