Man rsync says that "If you need to transfer a filename that contains whitespace, you'll need to either escape the whitespace in a way that the remote shell will understand, or use wildcards in place of the spaces.". I am regularly doing backups with rsync and notice that files names with a space in them copy properly, without any special escape or other characters. Is this a change in rsync? Is the warning in the man page no longer needed? I will say that my 'filenames' with spaces are mostly (if not all) directory names so perhaps rsync knows to handle directory names better than file names. Can anyone enlighten me? Larry
FILE NAME WITH SPACES -- this is 4 different space-separated parameters fed from the shell to the program "FILE NAME WITH SPACES" -- this is one parameter fed from the shell to the program FOLDER-NAME/ -- this is one parameter and means all the files in the directory FOLDER-NAME/ FOLDER-NAME -- this is one parameter and means the directory FOLDER-NAME/ (and presumably taking all the contents with the directory) Unless the program does something special to parse out the spaces in the parameters, what you are seeing is normal behavior. I assume that the directory names with spaces are actually subdirectories of whatever you are backing up, ie those name you specify on the command line. You can also use wild-cards in addition to the names with spaces to give the illusion that it understands.> -----Original Message----- > From: rsync-bounces at lists.samba.org > [mailto:rsync-bounces at lists.samba.org] On Behalf Of Larry Alkoff > Sent: Tuesday, August 11, 2009 10:04 PM > To: Rsync > Subject: Handling spaces in filenames > > Man rsync says that > "If you need to transfer a filename that contains whitespace, > you'll need to either escape the whitespace in a way that the remote > shell will understand, or use wildcards in place of the spaces.". > > I am regularly doing backups with rsync and notice that files > names with > a space in them copy properly, without any special escape or other > characters. > > Is this a change in rsync? > Is the warning in the man page no longer needed? > > I will say that my 'filenames' with spaces are mostly (if not all) > directory names so perhaps rsync knows to handle directory > names better > than file names. > > Can anyone enlighten me? > > Larry > -- > Please use reply-all for most replies to avoid omitting the > mailing list. > To unsubscribe or change options: > https://lists.samba.org/mailman/listinfo/rsync > Before posting, read: > http://www.catb.org/~esr/faqs/smart-questions.html >
On 11.08.2009 21:04, Larry Alkoff wrote:> Man rsync says that > "If you need to transfer a filename that contains whitespace, > you'll need to either escape the whitespace in a way that the remote > shell will understand, or use wildcards in place of the spaces.". > > I am regularly doing backups with rsync and notice that files names with > a space in them copy properly, without any special escape or other > characters. > > Is this a change in rsync? > Is the warning in the man page no longer needed? > > I will say that my 'filenames' with spaces are mostly (if not all) > directory names so perhaps rsync knows to handle directory names better > than file names.It only refers to white-spaces directly in the commandline, nothing else. You to "protect" things like this: rsync <whatever> "source dir/" "target dir/" (Local, nothing special) rsync <whatever> "source dir/" "destination:target\ dir/" (Remote space has to be "protected") or rsync <whatever> --protect-args "source dir/" "destination:target dir/" (Same as before, but rsync does the protecting itself) Bis denn -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous.