Does RoboCopy's /MIR switch (mirror) copy file permissions? Yes and no.
Posted: (EET/GMT+2)
The Sysinternals tool RoboCopy's /MIR command-line switch mirrors a directory tree: it copies new and changed files, and deletes files that no longer exist in the source. But by itself, the /MIR option does not decide whether permissions are copied. That part is controlled by the /COPY options.
By default, RoboCopy uses /COPY:DAT which copies:
- D = Data
- A = Attributes
- T = Timestamps
So, if you just run:
robocopy C:\Source D:\Target /MIR
...you get a mirrored folder structure, but not copied NTFS permissions.
To copy permissions as well, include /SEC = security in the copy options, for example:
robocopy C:\Source D:\Target /MIR /COPY:DATS /SEC
Or, simply like this:
robocopy C:\Source D:\Target /MIR /COPYALL
In short: the /MIR option controls the mirror behavior (including deletions), but whether permissions are copied depends on /COPY option and related switches. Always test on a small sample before running RoboCopy against important data.