You are not logged in.
Pages: 1
I have a external HD formatted in Ntfs, and I tried to copy in other external HD but there are errors with some directories, for example some files has a blank space in the end of the name or two points " : " . In the past I copy this files with Unison, a program to synchronize data, but there is another form to do that?
Offline
If you escape those characters, they should not pose a problem, forbidden are only / and the null character.
I would use rsync to move them, something like : rsync -aAXu SOURCE DESTINATION
Offline
Use single or double quotes around the file names with non allowed characters.
touch '!@#abc?:;'
file '!@#abc?:;'
!@#abc?:;: empty
ls -l '!@#abc?:;'
-rw-r--r-- 1 me me 0 Jul 22 12:46 '!@#abc?:;
echo "hello" > '!@#abc?:;'
cat '!@#abc?:;'
hello
rm '!@#abc?:;'On a FAT file system, some chars are not allowed, period.
Such as
/var/cache/pacman/pkg/python-setuptools-1:56.0.0-1-any.pkg.tar.zstYou can't copy that file to a little FAT formated usb drive. Not without a rename.
Offline
Actually the filename limitation is win32, not ntfs - you can mount ntfs in a way that it permits "\:*"?<>|" in filenames, but not access them from windows (so it's generally a dumb idea)
You can use https://archlinux.org/packages/community/x86_64/detox/ to sanitize filenames or fix them on the fly w/ bash variable substitutions or tr,
echo sick | tr is ufOffline
I tried: rsync -avu but it fails. Doing cp " file " when there are many files, it requires a lot of time. Detox is a good idea but fails when son files are linked to a file, and changing the name brokes the link.
Offline
Doing cp " file " when there are many files, it requires a lot of time.
Do you object the overhead of creating individual cp processes for every file or did you mean "typing cp '/src/foo:bar' '/dst/foo_bar' for 1000 files will take me 1000 minutes"?
In the latter case, you'd just need a script to recurse over the source path, some "dirname" and "mkdir -p" magic and eg. "$(echo $src_name | tr '\:*"?<>|' '_.+q()-')" …
Offline
Doing cp " file " when there are many files, it requires a lot of time.
Do you object the overhead of creating individual cp processes for every file or did you mean "typing cp '/src/foo:bar' '/dst/foo_bar' for 1000 files will take me 1000 minutes"?
In the latter case, you'd just need a script to recurse over the source path, some "dirname" and "mkdir -p" magic and eg. "$(echo $src_name | tr '\:*"?<>|' '_.+q()-')" …
Thank you is very good idea, but I don't now how to do a script. When I gottime I will try to learn.
Offline
Pages: 1