This patch adds an option --tr=BAD/GOOD to transliterate filenames. It can be used to remove characters illegal on the destination filesystem. Jeff Weber expressed interest in this: http://lists.samba.org/archive/rsync/2007-October/018996.html This patch is a COMPLETE HACK that covers the most common cases. Others are welcome to improve it. To use this patch, run these commands for a successful build: patch -p1 MAX_SERVER_ARGS) { /* Not possible... */ rprintf(FERROR, "argc overflow in server_options().\n"); exit_cleanup(RERR_MALLOC); diff --git a/rsync.yo b/rsync.yo --- a/rsync.yo +++ b/rsync.yo @@ -436,6 +436,7 @@ to the detailed description below for a complete description. verb( --read-batch=FILE read a batched update from FILE --protocol=NUM force an older protocol version to be used --iconv=CONVERT_SPEC request charset conversion of filenames + --tr=BAD/GOOD transliterate filenames --checksum-seed=NUM set block/file checksum seed (advanced) -4, --ipv4 prefer IPv4 -6, --ipv6 prefer IPv6 @@ -2373,6 +2374,22 @@ daemon uses the charset specified in its "charset" configuration parameter regardless of the remote charset you actually pass. Thus, you may feel free to specify just the local charset for a daemon transfer (e.g. bf(--iconv=utf8)). +dit(bf(--tr=BAD/GOOD)) Transliterates filenames on the receiver, after the +iconv conversion (if any). This can be used to remove characters illegal +on the destination filesystem. If you use this option, consider saving a +"find . -ls" listing of the source in the destination to help you determine +the original filenames in case of need. + +The argument consists of a string of characters to remove, optionally +followed by a slash and a string of corresponding characters with which to +replace them. The second string may be shorter, in which case any leftover +characters in the first string are simply deleted. For example, +bf(--tr=':\/!') replaces colons with exclamation marks and deletes backslashes. +Slashes cannot be transliterated because it would cause havoc. + +If the receiver is invoked over a remote shell, use bf(--protect-args) to +stop the shell from interpreting any nasty characters in the argument. + dit(bf(-4, --ipv4) or bf(-6, --ipv6)) Tells rsync to prefer IPv4/IPv6 when creating sockets. This only affects sockets that rsync has direct control over, such as the outgoing socket when directly contacting an