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

samba-bugs at samba.org samba-bugs at samba.org
Tue Jan 13 00:49:48 GMT 2009


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


matt at mattmccutchen.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX




------- Comment #1 from matt at mattmccutchen.net  2009-01-12 18:49 CST -------
Rsync is following traditional shell behavior, under which a wildcard pattern
that matches nothing is left unexpanded.  (Actually, in your case, rsync relies
on the remote shell to handle the wildcard, but rsync emulates the same
behavior when --protect-args is on.)  Thus, rsync tries to copy the file
"/var/log/httpd/access_log.*" with an asterisk in the name, which does not
exist, hence the code 23.  You'll get the same result with cp.  This is
reasonable because an unmatched pattern is often a mistake rather than a
genuine attempt to match zero files.

I suggest that you specify the containing directory as the source and use
filters to exclude all the files except the ones you want:

rsync -qPtdO -e ssh --include='access_log.*' --exclude='*'
root2 at mysite.com:/var/log/httpd/ /root/myoldLogs/

This will successfully do nothing if there are no matching files.

If you don't like including the containing directory in the file list, you
could do this instead:

rsync -qPt -e ssh --rsync-path='rsync --files-from=<(find /var/log/httpd/
-maxdepth 1 -name "access_log.*" -printf "%P\n")'
root2 at mysite.com:/var/log/httpd/ /root/myoldLogs/


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