Solution For Rsync and Cygwin Daylight Savings Timezone Problems

jw schultz jw at
Thu Apr 3 06:57:17 EST 2003

On Wed, Apr 02, 2003 at 03:33:30PM +0100, Martin Sapsed wrote:
> jw schultz wrote:
> > [...]
> >The impact of this may be minimized by running rsync with
> >the --modify-window=3601 command-line option.  This will
> >cause rsync to ignore modification time differences of one
> >hour will allow rsync jobs to complete in the usual time
> >period with a minimal impact on backup integrity.  To get
> >back to normal it will be necessary to run rsync with the
> >usual modify-window on all files.  This can be done in
> >stages.
> Am I right in thinking that if you use this option, files will still be 
> selected for syncing if the checksums are different, even if the times 
> are less than 3601 seconds apart?

If they have the same length and you don't use the -c
option which will slow things considerably.
Rsync will not ignore changes in file size which
significantly reduces the sorts of file mods that would be

It takes a very unusual pattern to produce a wrongful skip.
This is the script of what it takes to do it.

	modify file
	modify file

These three steps must occur in sequence and all within one
hour and the file size must remain unchanged.

Any modifications of the file more than one hour after the
last modification prior to the last rsync will be outside the
3601 second modify-window and picked up by the next rsync.

I don't suggest making 3601 the normal modify-window.  I
only say that setting it to 3601 will allow the deferral of
fixing the mod-times.

Here is another possibility that just occurred to me for
correcting with the problem.  This will change the
timestamps of the files.  Whether you use a positive or
negative shift will depend on which end you decide to

touch -d '01:00 13-apr-03' /tmp/cmpfile
find . -type f ! -newer /tmp/cmpfile | 3600.

------ -------

$offset = shift;

$offset += 0;

!$offset and die "must give offset";

while (<STDIN>)
	-w or next;
	$oldtime = (stat $_)[9];
	$oldtime or next;
	$newtime = $oldtime + $offset;
	utime $newtime, $newtime, $_;

	J.W. Schultz            Pegasystems Technologies
	email address:		jw at

		Remember Cernan and Schmitt

More information about the rsync mailing list