2

I am trying to copy my entire shares directory from one server to my current directory. Running the command:

rsync -avhP /shares .

it will copy 90% of the data to that directory but I am getting this error:

rsync: mkstemp "/mnt/L18_BACKUP/shares/AUDIT-DATA/TEMP_FROM_ROOT/.z*zMetaData.txt_TagIndexed.txt_AS_rename_AuditInfoFiles_AC.log.T1OJ1D" failed: Nos such files or directory (2)

The drive that I am copying the data to is a different windows server D: drive. It looks like there are some files with asterisks but not all of them. I am copying the data from a Unix server to a Windows server HDD.

Is there a way to ignore the characters that the system does not normally let you copy so they will copy them?

Sorry the file system is in NTFS on the windows server. I am backing up the files that are on the Unix box and cannot change the files they have to be kept as is. Also there is way to many that would have to be edited even if i could

5
  • 1
    curious why /mnt shows up when you indicate /shares as the source. Are you in the /mnt directory when you run the command? Is it a removable device (that potentially got removed)?
    – Jeff Schaller
    Feb 4, 2019 at 16:29
  • 1
    Do you have asterisk in name? Feb 4, 2019 at 16:36
  • 1
    What's the target filesystem type?
    – roaima
    Feb 4, 2019 at 17:47
  • @TrynaLearnSomethin A * in the name should not be an issue, on Unix systems.
    – Kusalananda
    Feb 4, 2019 at 18:19
  • You need to say what the actual filesystem in use is (it's not "Windows"). NTFS and FAT have different allowed characters, and different abilities to access things outside the norm. Are you able to rename the files on the source? Would it be OK if they were renamed on the target? Feb 4, 2019 at 19:31

1 Answer 1

0

Looks like some of the files you are trying to copy have reserved characters in them and that is why it is failing the way it is.

Reference found here: https://kenfallon.com/rsync-mkstemp-failed-no-such-file-or-directory-2/

There is no real effective way to ignore a character in a filename and have the backup be useful, as the names would no longer be the same. You would be hard pressed to remember what invalid character was ignored from which files in order to restore them, especially if the one in question was deleted or otherwise removed for awhile.

2
  • I suspect that is the exact same problem I am having with backing up my music collection to an ExFAT thumb drive. I am willing to consider reformatting the drive to something other than ExFAT before loading it with my backups, but the new file system MUST be read/write friendly under both Linux and MacOS. Otherwise, I'm writing a script to strip the reserved characters from the file names.
    – cjm
    Mar 31 at 2:07
  • Update: rename 's/[<:\|\?\*">]/_/g' **/* -v did the trick. Append a -n flag to do a dry run to preview changes. It replaces all incompatible characters with an underscore without mutating the directory structure.
    – cjm
    Mar 31 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.