How to use rsync when filenames contain double quotes?

Scott Wiersdorf scott at
Sat Jan 29 12:20:57 MST 2011

On Sat, Jan 29, 2011 at 11:48:27AM +0100, Walrus Foolhill wrote:
> I am trying to synchronize the content of the directory my_dir/ from /home
> to /backup. This directory contains a file which name has a double quote in
> it, such as to"to. Here is my rsync command:
> rync -Cazh /home/my_dir/ /backup/my_dir/


> And I get the following message:
> rsync: mkstemp "/backup/my_dir/.to"to.d93PZr" failed: Invalid argument (22)

For what it's worth, using your command and filename (to"to) both work
fine for me on OS X (both rsync v2.6.9 and v3.0.7), FreeBSD 4.7 (rsync
v2.6.9), and Linux 2.6.18 (rsync v3.0.7) and going between them. Can
you give more information on your system, rsync version, etc.?

Scott Wiersdorf
scott at

More information about the rsync mailing list