Fix for batch mode (was Re: batch mode maintainability)
Jos Backus
josb at cncdsl.com
Fri Jan 25 13:20:56 EST 2002
On Thu, Jan 24, 2002 at 12:22:58PM -0600, Dave Dykstra wrote:
> > Yes, I'll look at doing some documentation. What about a paragraph titled
> > ``About batch mode'' with a little explanation how it works, how it differs
> > from normal rsync operation and a small example?
>
> Sounds like a good idea. Of course, refer to the section under the entries
> for --write-batch and --read-batch.
OK, I may need help with the markup part though, so I'll post a rough draft
here first.
> > > Interesting tidbit: it apparently works with -W, because I noticed that
> > > when I make a small change to a large file the rsync_delta* file is
> > > large if my original destination is on the same machine as the source
> > > (because in that case -W is implied) but if my original destination is
> > > on a remote machine the rsync_delta* file is small, and both cases
> > > produce the correct result. Maybe -W should never be implied when
> > > --write-batch is on.
> >
> > Meaning that with --write-batch you'd always get the small delta file (-W
> > turned off)?
>
> Yes.
How about the patch below? It disables the automatic setting of -W (whole file
mode) when a local target directory is specified with --write-batch.
Index: main.c
===================================================================
RCS file: /cvsroot/rsync/main.c,v
retrieving revision 1.137
diff -u -r1.137 main.c
--- main.c 23 Jan 2002 05:51:07 -0000 1.137
+++ main.c 25 Jan 2002 02:20:00 -0000
@@ -656,6 +656,7 @@
extern char *shell_cmd;
extern int rsync_port;
extern int whole_file;
+ extern int write_batch;
extern int read_batch;
int rc;
@@ -709,8 +710,12 @@
p = find_colon(argv[argc-1]);
if (!p) {
local_server = 1;
- /* disable "rsync algorithm" when both sides local */
- whole_file = 1;
+ /*
+ * disable "rsync algorithm" when both sides local,
+ * except when creating a batch update
+ */
+ if (!write_batch)
+ whole_file = 1;
} else if (p[1] == ':') {
*p = 0;
return start_socket_client(argv[argc-1], p+2, argc-1, argv);
--
Jos Backus _/ _/_/_/ Santa Clara, CA
_/ _/ _/
_/ _/_/_/
_/ _/ _/ _/
josb at cncdsl.com _/_/ _/_/_/ use Std::Disclaimer;
More information about the rsync
mailing list