From a1a440c23e50c1a711bbe404456234895b8db79d Mon Sep 17 00:00:00 2001 From: David Dykstra Date: Tue, 29 May 2001 14:37:54 +0000 Subject: [PATCH] Make --whole-file the default when source and target are on the local machine. --- main.c | 3 +++ rsync.yo | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index f696474c..63fab0dc 100644 --- a/main.c +++ b/main.c @@ -581,6 +581,7 @@ static int start_client(int argc, char *argv[]) extern int am_sender; extern char *shell_cmd; extern int rsync_port; + extern int whole_file; char *argv0 = strdup(argv[0]); if (strncasecmp(URL_PREFIX, argv0, strlen(URL_PREFIX)) == 0) { @@ -627,6 +628,8 @@ static int start_client(int argc, char *argv[]) p = find_colon(argv[argc-1]); if (!p) { local_server = 1; + /* disable "rsync algorithm" when both sides local */ + whole_file = 1; } else if (p[1] == ':') { *p = 0; return start_socket_client(argv[argc-1], p+2, argc-1, argv); diff --git a/rsync.yo b/rsync.yo index 9da7023d..3717b9e5 100644 --- a/rsync.yo +++ b/rsync.yo @@ -1,5 +1,5 @@ mailto(rsync-bugs@samba.org) -manpage(rsync)(1)(3 Mar 2001)()() +manpage(rsync)(1)(29 May 2001)()() manpagename(rsync)(faster, flexible replacement for rcp) manpagesynopsis() @@ -395,8 +395,11 @@ are in the list of files being sent. This option can be quite slow, so only use it if you need it. dit(bf(-W, --whole-file)) With this option the incremental rsync algorithm -is not used and the whole file is sent as-is instead. This may be -useful when using rsync with a local machine. +is not used and the whole file is sent as-is instead. The transfer may be +faster if this option is used when the bandwidth between the source and +target machines is higher than the bandwidth to disk (especially when the +"disk" is actually a networked file system). This is the default when both +the source and target are on the local machine. dit(bf(-p, --perms)) This option causes rsync to update the remote permissions to be the same as the local permissions. -- 2.34.1