I have a NAS and I want to copy some directories on it to an exfat formatted external HDD.
Problem is paths / filenames may contain reserved characters for exfat (see https://en.wikipedia.org/wiki/Filename#Comparison_of_filename_limitations), (but they are UTF-8 encoded) for example:
/home/fricadelle/mount_point/my_mp3s/Jake "the snake" O'Brian/03 - is it music ?.mp3
Here " and ? are a problem. cp -r this folder or filename directly to my HDD results in cannot create regular file and No such file or directory errors.
I have not found yet a satisfactory solution. This How to bulk-rename files with invalid encoding or bulk-replace invalid encoded characters? suggests to bulk rename everything. I don't like that because the files play ok on my ubuntu desktop or mac, or my network audio player. I want to keep those characters in my NAS. I think I would also have to copy it first on my desktop, then bulk rename, then copy it over to my external HDD.
Ideally I would like to pass some option to some rsync-like that would map all forbidden characters to, say, space, on the fly. So that the file names / folder names are altered only on my external HDD.