LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-20-2010, 10:08 AM   #1
smithaa02
LQ Newbie
 
Registered: Aug 2010
Distribution: Ubuntu - 10.04
Posts: 7

Rep: Reputation: 0
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?
 
Old 08-20-2010, 10:19 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,115

Rep: Reputation: 218Reputation: 218Reputation: 218
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.
 
Old 08-20-2010, 10:22 AM   #3
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,115

Rep: Reputation: 218Reputation: 218Reputation: 218
Edit:

You might need the --iconv option? It looks like one of the computers is latin1 and the other is utf-8.
 
Old 08-20-2010, 10:32 AM   #4
smithaa02
LQ Newbie
 
Registered: Aug 2010
Distribution: Ubuntu - 10.04
Posts: 7

Original Poster
Rep: Reputation: 0
Tried that ( rsync -rauvOs --modify-window=1 ...) and it still didn't work (exact same result).

Last edited by smithaa02; 08-20-2010 at 10:38 AM.
 
Old 08-20-2010, 10:38 AM   #5
smithaa02
LQ Newbie
 
Registered: Aug 2010
Distribution: Ubuntu - 10.04
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Guttorm View Post
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]
 
Old 08-20-2010, 11:38 AM   #6
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,115

Rep: Reputation: 218Reputation: 218Reputation: 218
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)
 
Old 08-20-2010, 12:42 PM   #7
smithaa02
LQ Newbie
 
Registered: Aug 2010
Distribution: Ubuntu - 10.04
Posts: 7

Original Poster
Rep: Reputation: 0
Same error
 
Old 11-15-2010, 02:26 PM   #8
dahweeds
LQ Newbie
 
Registered: Nov 2008
Posts: 24

Rep: Reputation: 0
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)

Last edited by dahweeds; 11-15-2010 at 02:49 PM. Reason: added recursive detail
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Files seem to take up more space in destination after rsync copy Karderio Linux - Newbie 5 02-24-2012 08:30 PM
[SOLVED] shell script to copy newly changed files with rsync genderbender Programming 15 04-22-2010 07:27 AM
Unusual characters in X terminal apex.predator Slackware 15 07-22-2008 01:24 PM
rsync syntax to skip directory, but copy select files.. tnicol Linux - Software 3 07-24-2007 05:40 AM
sudo rsync -uvrlpot doesn't copy some files xpucto Linux - Newbie 1 01-15-2007 06:56 AM


All times are GMT -5. The time now is 06:26 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration