robocopy to NAS affecting target directory such that it is Hidden on macOS

ric982 1 Reputation point
2022-11-08T03:31:44.26+00:00

Have a WIndows 10 and a MacOS Monterey 12.6 system connected through an ethernet switch to a Synology DSM7 NAS box. I'm using robocopy in a .cmd script that I schedule nightly to backup windows volumes (other than C:) to the NAS. I can see the files are being backuped up OK looking on the NAS.The directory on the NAS is like:

\NetBackup\Intel1\Volumes\D (in the case of my D volume on Intel1)

On the Mac, I have the share mounted and the path to the directory there is:

/Volumes/NetBackup/Intel1/Volumes/

I can show hidden files in this directory in Finder and I see that directory D is there, but it is hidden. The files under /Volumes/NetBackup/Intel1/Volumes/D are not hidden. In the Mac terminal, I can

ls -laO /Volumes/NetBackup/Intel1/Volumes

And I can see the 'hidden' flag is set on the D directory. I can issue

chflags nohidden /Volumes/NetBackup/Intel1/Volumes/D

and it resets the hidden flag and the directory is visible as a normal directory in Finder. However, if I re-run the script with robocopy again, the D directory is hidden again. The robocopy command is:

robocopy D:\ \NAS1\NetBackup\Intel1\Volumes\D /xd --exclude-dirs-- /xf --exclude-files-- /log+:--log-file-- /mir /fft /np /dcopy:DAT /r:5 /w:5 /mt:32

Why would the robocopy command affect the target directory's hidden flag and is there a way to prevent that?

Windows Server Backup
Windows Server Backup
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Backup: A duplicate copy of a program, a disk, or data, made either for archiving purposes or for safeguarding valuable files from loss should the active copy be damaged or destroyed.
452 questions
Windows Server Storage
Windows Server Storage
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Storage: The hardware and software system used to retain data for subsequent retrieval.
631 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,193 questions
0 comments No comments
{count} votes