Paul Slootman
2012-Apr-17 18:02 UTC
Bug#624826: rsync: Bad interaction between -u and --partial
[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
Wayne Davison
2012-May-05 15:12 UTC
Bug#624826: rsync: Bad interaction between -u and --partial
I committed a fix that is similar to yours, but just skips the time change if a partial_dir is active. I like the 0-time choice for marking a partial file that didn't get finished. ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20120505/3bbb6aa6/attachment.html>