What do I need to do to rsync on Windows to make it keep special characters in filenames on Linux?

3

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.

RichieACC

Posted 2010-09-02T09:13:49.480

Reputation: 908

This question http://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 – 2010-09-02T09:24:36.143

take a look at rsyncs --iconv option – matthias krull – 2010-09-02T09:27:22.257

1When 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 – 2010-09-02T09:58:38.120

Answers

5

Adding the parameter

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

seems to have sorted the problem out.

RichieACC

Posted 2010-09-02T09:13:49.480

Reputation: 908

1

I got files with weird characters to work using cygwin's rsync 3.1.2, installed via setup-x86_64.exe, and NOT DeltaCopy's rsync, which seems to use an outdated cygwin1.dll.

qwr

Posted 2010-09-02T09:13:49.480

Reputation: 150