what is the right exit code for some vanished files?
Ming Zhang
blackmagic02881 at gmail.com
Sun Dec 16 18:47:44 GMT 2007
On Fri, 2007-12-14 at 23:27 -0500, Matt McCutchen wrote:
> On Fri, 2007-12-14 at 18:24 -0500, Ming Zhang wrote:
> > What should be the right exit code for vanished file in this scenario.
> >
> > (1) Use inotify or other mechanism to check changed files and then
> > generate a file list.
> >
> > (2) < file get deleted>
> >
> > (3) run rsync with --files-from with the old list.
> >
> > then send_file_list()->link_stat() will return errno 2 on some files and
> > then set exit code to 23.
> >
> > but shall rsync return 24?
>
> This issue has come up before:
>
> http://lists.samba.org/archive/rsync/2007-November/019177.html
missed this post. thx for pointing out.
>
> Code 23 is correct according to the current interpretation of
> --files-from, namely that the user intends to have each and every listed
> file copied and wants rsync to raise a red flag if one is missing. I
> agree that different behavior (probably enabled by an option) would be
> useful when passing --files-from lists from inotify. I'm not sure that
agree. now my own patch is to check errno, if ENOENT, then set to
VANISHED instead of PARTIAL. because i really want to tell if a file is
disappeared (by unlink which later inotify event will be handled) from a
file is fail to transfer because of io error or something else.
> 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...
>
> Matt
>
--
Ming Zhang
@#$%^ purging memory... (*!%
http://blackmagic02881.wordpress.com/
http://www.linkedin.com/in/blackmagic02881
--------------------------------------------
More information about the rsync
mailing list