Robocopy question

Im running this robocopy command and I want to make sure it just copies the files over and keeps the files in both location. Is the command below okay? Also is there any switch that would delete the original location?

C:\>robocopy \\server1  \\server2 *.* /E /MIR /SEC /R:0 /W:1 /COPY:DATSO /LOG:c:\roboc
opy.log
Thomas NSystems Analyst - Windows System AdministratorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NVITEnd-user supportCommented:
> ... switch that would delete the original location
Use /MOVE to move files and dirs (delete from source after copying)

Also use /DCOPY:T to copy Directory Timestamps. Else it will have the current time

Good info here...
http://ss64.com/nt/robocopy.html
Thomas NSystems Analyst - Windows System AdministratorAuthor Commented:
So the command I have above should be okay right? It should keep at both locations? Thanks
NVITEnd-user supportCommented:
/MIR copies (mirrors) the source. So, Yes... A copy at both locations. Don't forget the /DCOPY:T switch, too.

To gain confidence, try the command on a test folder. It doesn't have to be lots of files. Just include some folders, too.
zalazarCommented:
I would leave out parameter  /SEC  as this would imply /COPY:DATS
This because you are already specifying  /COPY:DATSO
You could also leave out parameter  /E  as /MIR already includes this option
Also include the no progress switch /NP as otherwise your logging will contain the progress info.
You could leave out *.* also as this is the default.
If you like to append an existing logfile then just change /LOG: to /LOG+:c:\robocopy.log

An example:
robocopy "\\server1\share" "\\server2\share" /MIR /NP /R:0 /W:1 /COPY:DATSO /DCOPY:T /LOG+:c:\robocopy.log

Open in new window


Also keep in mind that the robocopy versions that come with the OS can have problems with copying NTFS permissions.
So please check if the NTFS security is copied over correctly.

If it won't copy the NTFS security then please use the older robocopy XP010 version which can be extracted from the Windows Server 2003 Resource Kit Tools
https://www.microsoft.com/en-us/download/details.aspx?id=17657
I would not install the software but just unpacking the files.
Unpack rktools.exe with e.g. 7-Zip
Unpack rktools.msi and copy "robocopy.exe" to the directory where you want to run the script.
The /DCOPY:T switch is not supported with this older version.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.