rsync: transmitting always whole files

Schulz, Frank FSchulz at mbisoftware.de
Fri Mar 15 20:51:29 EST 2002


Hi,

I use rsync in the following way to update some remote files over a low
bandwidth line:
   rsync -v -r -z -t -p <local dir> <user>@<host>:<dir on host>
After updating from rsync 2.5.2 to 2.5.4 I noticed that modified files are
always copied completely. The problem seems to be related to the new (in
2.5.3) option -no-whole-file. The global variable whole_file is initialized
to -1 in options.c. In server_options() (options.c) it is set to zero if the
original value has not been changed. A value of zero on whole_file is not
transmitted to the remote rsync however.
So the remote rsync has -1 instead of zero on its whole_file variable. To
fix the problem I applied the following patch that forwards --no-whole-file
to the remote side if whole_file has a value of zero:

--- options.c.O	Fri Mar 15 10:25:42 2002
+++ options.c	Fri Mar 15 10:27:24 2002
@@ -758,6 +758,8 @@
 		args[ac++] = compare_dest;
 	}
 
+	if (!whole_file)
+		args[ac++] = "--no-whole-file";
 
 	*argc = ac;
 }


Best regards,

Frank Schulz
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the rsync mailing list