DO NOT REPLY [Bug 6025] New: 0 files to consider should not return code 23

samba-bugs at samba.org samba-bugs at samba.org
Mon Jan 12 11:02:29 GMT 2009


https://bugzilla.samba.org/show_bug.cgi?id=6025

           Summary: 0 files to consider should not return code 23
           Product: rsync
           Version: 2.6.9
          Platform: x86
               URL: http://www.paguito.com
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P3
         Component: core
        AssignedTo: wayned at samba.org
        ReportedBy: pabangel at yahoo.com
         QAContact: rsync-qa at samba.org


When rsync is asked to download files and the result is CORRECTLY "0 files to
consider", either because the directory just happens to be empty at the moment
or the files matching the pattern are CORRECTLY not present in the directory,
it returns a CODE 23. This is wrong.

This behavior is incorrect, CODE 23 means "Partial transfer due to error". In
such a case there was CORRECTLY nothing to transfer, therefore, the program
should exit gracefully with a CODE 0 "Success". Since it has nothing to do and
therefore it did nothing. 

Returning CODE 23 is missleading for other programmers using rsync inside a
shell script as is leads them to believe that there were some actual files to
download but for some reason rsync was unable to download them.

In my case, as an example i am downloadig Apache log files from a test server
this files are sometimes rotated automatically by cron or sometimes manually
deleted.

When I have rsync download all the log files in the usual Apache log directory 
/var/log/httpd , and the directory just happens to be empty:

rsync -qPt -e ssh root2 at mysite.com:/var/log/httpd/access_log.* /root/myoldLogs/

I get:

rsync: link_stat "/var/log/httpd/access_log.*" failed: No such file or
directory (2)

rsync error: some files could not be transferred (code 23) at main.c(1385) 



IMO: "some files could not be transferred"  is incorrect as there were no files
no transfer.

Note that removing the --verbose option or adding the --quiet option did not
solve the problem.

I have seen some people using a workaround by adding a single file using the
"touch" command to create a single empty file that would match the pattern on
the rsync command, so that "0 files to consider" would be "1 files to consider"
and rsync returns CODE 0 "Success".

Thank you.

Pablo Angel Rendon


-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


More information about the rsync mailing list