Bug 4371 - unable to rsync filenames with whitespace from remote source
Summary: unable to rsync filenames with whitespace from remote source
Status: RESOLVED INVALID
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.8
Hardware: x86 Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-06 09:55 UTC by Tim Wunder
Modified: 2007-02-06 11:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Wunder 2007-02-06 09:55:10 UTC
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)
done
client: nothing to do: perhaps you need to specify some filenames or the --recur
sive option?
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.
Comment 1 Wayne Davison 2007-02-06 11:28:49 UTC
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:

http://rsync.samba.org/ftp/rsync/rsync.html
Comment 2 Wayne Davison 2007-02-06 11:42:26 UTC
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.