what is the right exit code for some vanished files?

Matt McCutchen matt at mattmccutchen.net
Sat Dec 15 04:27:12 GMT 2007


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

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
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.

Matt



More information about the rsync mailing list