what is the right exit code for some vanished files?
blackmagic02881 at gmail.com
Thu Dec 20 03:25:33 GMT 2007
On Wed, 2007-12-19 at 21:22 -0500, Matt McCutchen wrote:
> On Sun, 2007-12-16 at 13:47 -0500, Ming Zhang wrote:
> > > even code 24 is in order because the nonexistence of a --files-from
> > > entry cannot affect the correctness of a run with --delete in the way
> > > that a traditional vanishing can.
> > not quite understand what u meant here...
> Sorry. I was thinking of this comment:
> To elaborate:
> Rsync generally satisfies the following correctness property: at the end
> of a successful run with no concurrent modification of the destination,
> every aspect of the destination that is within the scope of the run (as
> determined by the file-list and options) reflects a state that the
> corresponding aspect of the source had at some time during the run.
> Suppose files src/A and dest/A differ. Suppose we run "rsync -a
> --delete src/ dest/" and delete src/A during the run. To satisfy the
> property, rsync should either delete dest/A or fill it with the
> pre-deletion contents of src/A. However, if src/A vanishes after it is
> added to the file-list but before the sender can transfer it, rsync
> reports src/A as vanished and leaves dest/A alone, violating the
> correctness property. I believe that the code 24 is needed to warn the
> user that correctness may have been violated in this way.
so this file-list is the internal file list, not the --files-from
rsync's goal is to keep src and dest in same state (same content, or the
fact that none side has this object) WHEN it process one particular
object. so if a file is added to file list, just means rsync need to
maintain same state when it handle that file at that moment, let us say
rsync copy half the content and then file vanished, then rsync should
detect the new state of this file (deleted) and delete the dest/A as
of course after rsync finished process A and move on to B, and A get
changed, it is not rsync responsibility to detect the change and sync
> On the other hand, if src/A vanishes before it is added to the file-list
> (as in the inotify case), rsync deletes dest/A from the destination, so
> the run satisfies the correctness property. Then the only issue is
> whether to alert the user that s/he may have mistyped the --files-from
> entry. By default, rsync alerts the user with a code 23. In the case
> of inotify, an option would indicate that this alerting is not desired,
> and no exit code would be needed at all.
@#$%^ purging memory... (*!%
More information about the rsync