LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Rsync can't copy certain files with unusual characters while cp can (https://www.linuxquestions.org/questions/linux-software-2/rsync-cant-copy-certain-files-with-unusual-characters-while-cp-can-827462/)

smithaa02 08-20-2010 10:08 AM

Rsync can't copy certain files with unusual characters while cp can
 
On my Ubuntu box, I have a mounted windows share connected via gvfs called graphics.

I want to backup everything on a nightly basis from graphics to backupserver/graphics . If I use rsync, it will not copy files that have parent directories with funky characters in them (but the directories themselves will be copied!). Everything else gets rysnced just fine.

So:

graphics/test/•macdir/picture.psd

...when rsynced over to ...

backupserver/graphics/

...gives the error:

rsync: mkstemp "/home/administrator/.gvfs/drobo on x.x.x.x/linux_backups/graphics/test/⢠macdir/.picture.psd" failed: Operation not supported (95)

The directory •macdir gets created but there is nothing in there. This happens for all files underneath dirs with funky names.

The funny thing is cp -Rf works perfectly! Directory and child files all get copied over no matter how strange the characters get in the directory names.

So I assume this is an issue with rsync. Any ideas?

Guttorm 08-20-2010 10:19 AM

Try add the -s option with rsync, quote from man rsync:

Quote:

-s, --protect-args
This option sends all filenames and most options to the remote
rsync without allowing the remote shell to interpret them. This
means that spaces are not split in names, and any non-wildcard
special characters are not translated (such as ~, $, ;, &,
etc.). Wildcards are expanded on the remote host by rsync
(instead of the shell doing it).

If you use this option with --iconv, the args related to the
remote side will also be translated from the local to the remote
character-set. The translation happens before wild-cards are
expanded. See also the --files-from option.

Guttorm 08-20-2010 10:22 AM

Edit:

You might need the --iconv option? It looks like one of the computers is latin1 and the other is utf-8.

smithaa02 08-20-2010 10:32 AM

Tried that ( rsync -rauvOs --modify-window=1 ...) and it still didn't work (exact same result).

smithaa02 08-20-2010 10:38 AM

Quote:

Originally Posted by Guttorm (Post 4072490)
Edit:

You might need the --iconv option? It looks like one of the computers is latin1 and the other is utf-8.

How would I use that? I added --iconv to my command but got new error:

iconv_open("UTF-8", "...mypath...") failed
rsync error: requested action not supported (code 4) at rsync.c(120) [sender=3.0.7]
administrator@linuxbackups:~/.gvfs/graphics on x.x.x.x$ rsync error: received SIGUSR1 (code 19) at main.c(1306) [sender=3.0.7]

Guttorm 08-20-2010 11:38 AM

It doesn't support UTF-8? You could try to disable the locale stuff with for example:

LC_ALL=C ; LANG=C ; export LC_ALL LANG

(Before the rsync)

smithaa02 08-20-2010 12:42 PM

Same error :(

dahweeds 11-15-2010 02:26 PM

I just had this same problem.
This worked to move the file from windows xp pc to fedora 14 linux:
Code:

rsync -avih .gvfs/windows/share/big\ archive.zip /my/archives/
but this failed to copy it back:
Code:

rsync -avih /my/archives/big\ archive.zip  .gvfs/windows/share/
....
rsync: mkstemp ".gvfs/windows/share/.big\ archive.zip.OoP9f7" failed: Operation not supported (95)

cp also worked as in the original post:
Code:

cp /my/archives/big\ archive.zip  .gvfs/windows/share/
ANSWER:
This made it work on the way back:
Code:

rsync -hicov /my/archives/big\ archive.zip  .gvfs/windows/share/
You should add the r option for directory contents.
Code:

rsync -rhicov /my/archives/  .gvfs/windows/share/


I don't have any explanation, but my guess is a conflict happens with the -a options even when using -co. Unfortunately too, -c slows him down much because of checking the sum.


Here are some other failures with different numbers though:

Code:

rsync -avio /my/archives/big\ archive.zip  .gvfs/windows/share/
...
rsync error: some files/attrs were not transfer.... (code 23)

and this
Code:

rsync -avic /my/archives/big\ archive.zip  .gvfs/windows/share/
...
rsync error: some files/attrs were not transfer.... (code 23)

and this
Code:

rsync -avico /my/archives/big\ archive.zip  .gvfs/windows/share/
...
rsync error: some files/attrs were not transfer.... (code 23)



All times are GMT -5. The time now is 06:14 PM.