CAUTION: If you use the /MIR option it can be very destructful. A improper path or typo can delete files you need. USE WITH CAUTION!!!
Out of the box, I was unable to get it to copy folder and file permissions. Eventually stumbled across this command that worked. You can look up all the options on your own.
ROBOCOPY [SOURCE_DATA] [DESTINATION_DATA] /B /NOSD /NODD /E /V /TS /FP /COPYALL /W:1 /R:1 /XD "System Volume Information" "DfsrPrivate" /LOG:c:\robocopy.log /TEE
The options used in the command above are:
- /B copy in backup mode
- /NOSD indicates that no source directory is specified
- /NODD indicates that no destination directory is specified
- /E include empty subdirectories
- /V verbose
- /TS include source file timestamp in output
- /FP include full path in output
- /COPYALL copy all file info/security DATSOU
- /W:1 1 second between retries
- /R:1 1 retry
- /LOG:c:\robocopy.log Log file creation
- /TEE output to console window too
- /XD Exclude Driectoryies - Seperated by spaces.
Use quotes if directory has spaces in its name.