Jeff Weber
2007-Oct-30 15:20 UTC
rsync and translating restricted NTFS filename characters
I am backing up files from Linux to a NTFS using rsync. I have the NTFS mounted on Linux via CIFS. I am discovering errors while attempting to backup files with restricted NTFS characters, like : [colon]. For example, I am unable to backup my crucial maildirs, as a colon is encoded in each Linux file path. Is there a solution to rsync Linux file paths with restricted NTFS characters, to NTFS? Perhaps there exists a solution to remap. say, Linux path ; [colon] to an alternate character ! [exclamation mark] on NTFS ? thanks, Jeff
Matt McCutchen
2007-Nov-06 05:04 UTC
rsync and translating restricted NTFS filename characters
On Tue, 2007-10-30 at 10:07 -0500, Jeff Weber wrote:> Is there a solution to rsync Linux file paths with restricted NTFS > characters, to NTFS? Perhaps there exists a solution to remap. say, > Linux path ; [colon] to an alternate character ! [exclamation mark] on > NTFS ?Rsync currently does not support that sort of character mapping. I hacked up a patch to rsync (attached) to add a --tr option that performs it. '--tr=:/!' should accomplish what you need. Wayne: You can include the patch in patches/ if you like; I doubt the patch is worth your effort to maintain it, but you did include the ACL patch when it was at a similar stage. Matt -------------- next part -------------- A non-text attachment was scrubbed... Name: transliterate.diff Type: text/x-patch Size: 5450 bytes Desc: not available Url : http://lists.samba.org/archive/rsync/attachments/20071106/93396402/transliterate.bin
Wayne Davison
2007-Nov-06 05:25 UTC
rsync and translating restricted NTFS filename characters
On Tue, Nov 06, 2007 at 12:04:19AM -0500, Matt McCutchen wrote:> This patch adds an option --tr=BAD/GOOD to transliterate filenames.Both sides need identical file names in the list when sorting, otherwise a name could sort into different spots on each side. The iconv code deals with this by using an index into the unsorted file list, so you might want to make use of that code. ..wayne..
Matt McCutchen
2007-Nov-06 13:30 UTC
rsync and translating restricted NTFS filename characters
On Mon, 2007-11-05 at 21:24 -0800, Wayne Davison wrote:> On Tue, Nov 06, 2007 at 12:04:19AM -0500, Matt McCutchen wrote: > > This patch adds an option --tr=BAD/GOOD to transliterate filenames. > > Both sides need identical file names in the list when sorting, otherwise > a name could sort into different spots on each side. The iconv code > deals with this by using an index into the unsorted file list, so you > might want to make use of that code.Oops! I overlooked that issue because I only tested with one file; thanks for pointing it out. I have updated the patch (attached) to activate the need_unsorted_flist code when a --tr option is passed. Matt -------------- next part -------------- A non-text attachment was scrubbed... Name: transliterate.diff Type: text/x-patch Size: 7584 bytes Desc: not available Url : http://lists.samba.org/archive/rsync/attachments/20071106/3545f516/transliterate.bin
Matt McCutchen
2007-Nov-06 20:31 UTC
rsync and translating restricted NTFS filename characters
Jeff, Wayne has cleaned up my patch a bit. The new version is at: http://cvs.samba.org/cgi-bin/cvsweb/rsync/patches/transliterate.diff?rev=1.1&content-type=text/x-cvsweb-markup Matt On Tue, 2007-11-06 at 08:29 -0500, Matt McCutchen wrote:> On Mon, 2007-11-05 at 21:24 -0800, Wayne Davison wrote: > > On Tue, Nov 06, 2007 at 12:04:19AM -0500, Matt McCutchen wrote: > > > This patch adds an option --tr=BAD/GOOD to transliterate filenames. > > > > Both sides need identical file names in the list when sorting, otherwise > > a name could sort into different spots on each side. The iconv code > > deals with this by using an index into the unsorted file list, so you > > might want to make use of that code. > > Oops! I overlooked that issue because I only tested with one file; > thanks for pointing it out. I have updated the patch (attached) to > activate the need_unsorted_flist code when a --tr option is passed. > > Matt
Jeff Weber
2007-Nov-09 21:49 UTC
rsync and translating restricted NTFS filename characters
Matt & Wayne: The transliterate patched worked great. I can now backup and restore to/from a SMB NTFS share. Many thanks for taking the time to spin me a patch! Jeff Weber On Tuesday 06 November 2007 02:30:35 pm Matt McCutchen wrote:> Jeff, > > Wayne has cleaned up my patch a bit. The new version is at: > > http://cvs.samba.org/cgi-bin/cvsweb/rsync/patches/transliterate.diff?rev=1. >1&content-type=text/x-cvsweb-markup > > Matt > > On Tue, 2007-11-06 at 08:29 -0500, Matt McCutchen wrote: > > On Mon, 2007-11-05 at 21:24 -0800, Wayne Davison wrote: > > > On Tue, Nov 06, 2007 at 12:04:19AM -0500, Matt McCutchen wrote: > > > > This patch adds an option --tr=BAD/GOOD to transliterate filenames. > > > > > > Both sides need identical file names in the list when sorting, > > > otherwise a name could sort into different spots on each side. The > > > iconv code deals with this by using an index into the unsorted file > > > list, so you might want to make use of that code. > > > > Oops! I overlooked that issue because I only tested with one file; > > thanks for pointing it out. I have updated the patch (attached) to > > activate the need_unsorted_flist code when a --tr option is passed. > > > > Matt
Maybe Matching Threads
- [patch] Replace illegal characters in filenames for FAT (switch)
- [Bug 10074] New: rsync reorders --from-files alphabetically
- unsorted - suggestion for performance improvement and ALTREP support for POSIXct
- Expected behaviour of is.unsorted?
- multiple issues with is.unsorted()