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.

We're in the process of implementing an offsite backup of all our servers to a remote Linux server. We're using rsync over ssh. What I've found is that characters such as ñ, ö, ô and ã are replaced on the Linux server with underscores. I don't mind if it changes these characters in the filenames of documents, but when it renames a language pack from Español.clx to Espa_ol.clx, it could cause issues for us further down the line.

My current command-line is:

rsync -v -rlt -z --chmod=a=rw,Da+x -u --delete -e "ssh -i <keyfile>" <source> <destination>

What do I need to do differently to make the special characters copy over correctly?

EDIT: For the initial sync which will take place locally, before the machine is moved offsite, I have SAMBA enabled. I am able to copy files from Windows to the Samba share, retaining the original filename, though it looks different in the Linux directory listing, i.e. têst becomes têst These files get deleted by rsync when it runs, as it does not match the filenames.

share|improve this question
    
This question superuser.com/questions/91967/rsync-character-set-problems is similar, but not relevant. I'm not mounting the Windows share in Linux, rather using the rsync client on the Windows machine directly. –  RichieACC Sep 2 '10 at 9:24
    
take a look at rsyncs --iconv option –  matthias krull Sep 2 '10 at 9:27
    
When I use --iconv=utf-16, which is, as I understand it, the encoding that windows uses, rsync dies with: [sender] cannot convert filename: . (Invalid argument) –  RichieACC Sep 2 '10 at 9:58

1 Answer 1

up vote 4 down vote accepted

Adding the parameter

--iconv=ISO-8859-1,utf-8

seems to have sorted the problem out.

share|improve this answer

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.