robocopy w:\ d:\ /XD "W:\Profiles" "W:\Exchange" /MIR /R:3 /w:9 /sec /secfix
w: is the source d: is the destination
/XD stands for exclude directory
/MIR means mirror
/R:3 is the number of retries
/w:9 is the number of seconds to wait between retries
/sec is copy security
/secfix - i think that means fix security if there are errors..not sure i forget
=====================================================
robocopy "\\wasserrussDC1\CompanyShare" "\\wasserrussDC2\CompanyShare" /XD /MIR /R:3 /w:9 /sec /secfix
=====================================================
run it first with the /l option which will test the command without copying.
robocopy E:\ G:\ /MIR /R:3 /w:9 /copyall /secfix /B /V /tee /log+:c:\robocopy.txt /l
/MIR – Mirrors a directory tree. This will allow us to run the command multiple times. The 2 drives will be synced. Any files that are deleted on the E:\ drive will also be deleted on the G:\ drive.
/R:3 - Failed copies will be retried 3 times. Files that are open will usually fail. We will have to run the command after hours to make sure files that are opened during the day will get copied.
/w:9 – Specifies the wait time of 9 seconds between retries.
/copyall – Copies all information. This will copy over the security settings of the files and folders.
D Data
A Attributes
T Time stamps
S NTFS access control list (ACL)
O Owner information
U Auditing information
/secfix - Fixes file security on all files, even skipped ones. If the security settings are changed they will also be changed on the destination.
/B – Backup mode. This will allow Robocopy to copy a folder even though my username does not have rights to the folder.
/V – verbose logging
/tee – output to command prompt and log file at the same time
/log+:c:\robocopy.txt – log file output
/l – Test option.