-c Option

jw schultz jw at pegasys.ws
Fri May 31 17:36:02 EST 2002


On Fri, May 31, 2002 at 06:27:27PM +0200, Dick Streefland wrote:
> On Thursday 2002-05-30 12:43, Michael Montero wrote:
> | 	That's great news.  I believe this applies to me just fine and I
> | can turn off the checksum.  Quick question....can anyone explain to me
> | when the data in a file might change without changing the mtime, ctime or
> | size?  I'm not sure I've ever come across that before.  An example might
> | help me determine if I can safely remove -c.
> 
> I ran into a situation where I had to use the -c option. I use two
> rsync commands to install Linux onto new PCs, the first one to "clone"
> a system, and a second one to update a few host specific files such as
> /etc/hostname, /etc/network/interfaces etc. The host specific files
> are automatically generated from template files, using a compact
> description of each machine. This script runs so fast that multiple
> files will get the same mtime. So, it is possible that some host
> specific files are not updated by the second rsync command, because
> the mtime is the same as the mtime on the master.
> 
> On one occasion, a machine came up with the same hostname as the
> master machine after the installation. Furtunately, the file with the
> IP number was correct!  I now use the -c option on the second rsync,
> which is not a problem, because the number of files is very limited.
> 
> BTW: I previously used NFS with find/cpio to clone Linux installations,
>      but rsync is *way* faster, 2-3 times faster on a 10 Mb network.

Interesting story and a good example.

PS.  I would have inserted a delay between generating the
master set and the machine specific ones or recursively touched
the sets with different times (find blah -type f -print
|xargs touch).  Much faster than -c.

-- 
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt




More information about the rsync mailing list