Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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:

rsync -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 info, rsync works well when the synchronized filenames contain single quote, parenthesis and space. Thus, why is it bugging with a double quote? Thanks for any help.

share|improve this question
    
What's the version of both rsyncs? –  Ignacio Vazquez-Abrams Jan 29 '11 at 1:36
    
rsync version 3.0.7 protocol version 30 (on Ubuntu 10.04 Lynx Lucide) –  tflutre Jan 29 '11 at 10:13

3 Answers 3

up vote 2 down vote accepted

In fact, it happened that the directory /backup/my_dir/ was on a USB hard-drive formatted in FAT. Rsync developpers told me that it was this filesystem that doesn't allow double quotes in filenames. After reformatting my USB hard-drive into ext3, rsync worked smoothly, even with filenames containg double quotes.

share|improve this answer
    
Same thing here. For me it was a bunch of files that had a colon (:) in the file name. I just renamed them using the top answer from commandlinefu.com/commands/view/8374/… and was good to go. –  ImperviousClarity Aug 1 '13 at 8:19

This seems to be a bug in rsync, where you cannot do much about it. Feel free to report it to the rsync developers.

One solution would be to rename all files with double quotes in them. They shouldn't be there in the first place anyway.

share|improve this answer
1  
Why shouldn't they? –  Dennis Williamson Jan 29 '11 at 3:45
    
The files with double quotes in their names are taken from MusicBrainz when importing my CDs into Rhythmbox. Therefore I don't want to rename all of them... As you suggest, I will report the bug. –  tflutre Jan 29 '11 at 10:15

Have you tried using the octal representation of the double-quotes (i.e. \042). I am not sure if rsync supports it, but it's worth a try.

share|improve this answer
    
The OP isn't specifying the filename, rather only the containing folder. –  Dennis Williamson Jan 29 '11 at 3:45
    
Indeed, but this doesn't invalidate my suggestion! He mentions that he has one file with double-quote in this directory, so he could just issue a separate command to sync this file (if my suggestion works). Let's just let the user judge to what extent this workaround would fit his need. –  Christian Vincenot Jan 29 '11 at 9:56
    
I answered above to Martin Scharrer why I won't rename all my files, but thanks anyway. –  tflutre Jan 29 '11 at 10:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.