2

I'm backing up on a linux to rsync data from a remote apple mac to save locally.

linux/mac use "/" or ":" to define path hierarchy, so if mac filenames contain a "/", then rsync replaces the "/" with a ":" to stay safe.

however, sharing/networking this backup back to mac causes troubles this way.

Is there a way I can tell rsync to take another character, ie "_"?

I could rename my files using

find /path/to/basedir/* -iname "*:*"  | tac |  sed 's/\(.*\):\(.*\)$/mv "&" "\1_\2"/' | sh

but this breaks the rsync incremental magic.

Thanks!

Manu
  • 43
  • 3

1 Answers1

4

It isn't rsync doing the translation; it's done by the kernel and filesystem APIs (see this previous question and the linked USENIX paper). The tricky character appears as a slash in MacOS-heritage APIs, and as a colon in unix-heritage APIs; rsync uses unix-heritage APIs, so it sees a colon.

The best solution isn't to try to translate the character differently, it's to figure out what's going wrong with the sharing/networking you're using, and figure out why it isn't doing the appropriate translation.

Community
  • 1
  • 1
Gordon Davisson
  • 118,432
  • 16
  • 123
  • 151
  • Thanks, good approach. It turned out I could solve the problem by rechecking same versions of rsync and upgrade netatalk. M – Manu Mar 16 '15 at 04:36