Bug 7691 - rsync remove-source-files and opened file
Summary: rsync remove-source-files and opened file
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.0
Hardware: All Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2010-09-21 04:01 UTC by Peter Straka
Modified: 2011-06-18 19:32 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Peter Straka 2010-09-21 04:01:20 UTC
when I use option remove-source-files and source files is opened and growing
rsync copy partial source file and after copying remove it even though in time after copying the files are different

I suggest to check difference after file is copying and if source and destination are different don`t remove the source file

next improve is to setup options like remove-source-file-delay to setup some time after copying to check difference between source and destination and remove source only if the files are the same

next improve is to setup options like remove-source-file-loop to setup numbers of loop to try if source file was already closed 
if remove-source-file-loop=0 it will be forever

I hope this scenario could be implemented independently on OS and help many people to use rsync for opened files.
Comment 1 Wayne Davison 2011-06-18 19:32:24 UTC
While the user should not be getting themselves into this situation (if they're smart about it), it is good for rsync to help the user not shoot themselves in the foot.  I have made rsync re-stat the file and skip the remove if the size or mtime is different.

This will be fixed in 3.1.0.  I've also added some helpful hints in the manpage on how best to use --remove-source-files.