When trying to rsync files located on a remote server using:
rsync -av remote.domain.com:/path/to/files/with\ whitespace/ /path/to/local/destination
The rsync fails with a message similar to:
receiving file list ... rsync: link_stat "/path/to/files/with" failed: No such file or directory (2)
rsync: link_stat "/root/whitespace/." failed: No such file or directory (2)
client: nothing to do: perhaps you need to specify some filenames or the --recur
rsync error: some files could not be transferred (code 23) at main.c(723)
Doing the transfer the other way works. For example:
rsync -av /path/to/files/with\ whitespace/ remote.domain.com:/path/to/local/destination
would copy the files properly.
This is tested from CentOS 4.4 with rsync 2.6.3 and Fedora Core 4 and 6 using rsync 2.6.8.
Please read the ADVANCED USAGE section of the man page where the interpretation of spaces in the remote args is explained. You can read it online, if you like:
One other suggestion for those times when you are scripting an rsync pull of arbitrary files where it is unknown if spaces (or other shell-interpreted characters) are present or not: the use of the --files-from option will pass the name(s) without any need for quoting.