Bug#624826: rsync: Bad interaction between -u and --partial

Paul Slootman paul at debian.org
Tue Apr 17 12:02:03 MDT 2012


[resending, I made a typo in the list address]

[ Please Cc: 624826-forwarded at bugs.debian.org on any replies ]

Please see the bug report below. In short, when using --partial together
with --update, an interrupted file will get the current timestamp, and
hence when redoing the transfer the file is skipped due to --update.

I've created a patch that sets the timestamp to 0 when a file transfer
is interrupted, which was suggested by the bug reporter and sounds
sensible to me.

Any possible hidden gotcha's?


Paul


--- a/cleanup.c	2012-04-15 14:14:02.913993934 +0200
+++ b/cleanup.c	2012-04-15 14:13:58.834033097 +0200
@@ -157,8 +157,9 @@
 				flush_write_file(cleanup_fd_w);
 				close(cleanup_fd_w);
 			}
+			cleanup_file->modtime = 0; /* solves problem with --partial --update */
 			finish_transfer(cleanup_new_fname, fname, NULL, NULL,
-					cleanup_file, 0, !partial_dir);
+					cleanup_file, 1, !partial_dir);
 		}
 
 		/* FALLTHROUGH */


On Sun 01 May 2011, Samuel Thibault wrote:
> 
> Hello,
> 
> My rsync script uses both options -u and --partial. This results into
> partial files not being completed:
> 
> - start a transfer, stop it. --partial makes the file be left to avoid
>   re-transferring the beginning of the file
> - restart the transfer. Since destination already has a file (the one
>   left by --partial), -u prevents rsync from transferring the remainder
>   of the file.
> 
> Maybe --partial should for instance set the file time to 1970-01-01 to
> mark the file as "partial" and make sure that further rsync calls etc.
> will continue the transfer?
> 
> Samuel


More information about the rsync mailing list