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: way...@samba.org
        ReportedBy: paban...@yahoo.com
         QAContact: rsync...@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 ro...@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.
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to