Robocopy parameters.


I need to create two bat jobs to run robo copy between two file shares.  

The first job will run every hour to copy differential data from Mon to Thursday.  The second job will run on Friday to mirror data.

Can someone advise the parameters I should use?  I would like to try the below but not sure if any parameter(s) should be added also.  


Hourly differential job
ROBOCOPY \\sourceserver\share \\destserver\share /s /e /xo

Weekly Miirror job
ROBOCOPY \\sourceserver\share \\destserver\share /s /e /mir
Who is Participating?
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.

Patrick BogersDatacenter platform engineer LindowsCommented:

/s and /e are opposites, include empty dirs but dont include empty dirs.... makes no sense.
/xo exclude old dirs, why?

 Robocopy \\SourceServer\Share \\DestinationServer\Share /e     Will suffice (Maybe /xo)

Mirro job would look like:
Robocopy \\SourceServer\Share \\DestinationServer\Share /MIR /FFT /Z /XA:H /W:5


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
nav2567Author Commented:
Thanks.  So, Robocopy \\SourceServer\Share \\DestinationServer\Share /e will copy only differential by default?
Shaun VermaakTechnical SpecialistCommented:
Always include /XO so that if destination is updated, source do not overwrite it
 Acronis Global Cyber Summit 2019 in Miami

The Acronis Global Cyber Summit 2019 will be held at the Fontainebleau Miami Beach Resort on October 13–16, 2019, and it promises to be the must-attend event for IT infrastructure managers, CIOs, service providers, value-added resellers, ISVs, and developers.

Patrick BogersDatacenter platform engineer LindowsCommented:

Shaun, why exclude older files(/xo)
Shaun VermaakTechnical SpecialistCommented:
If you copy files from source to destination and for some reason a file in the destination gets updated, without the /XO option the destination file (which is now a newer version) will be overwritten
Patrick BogersDatacenter platform engineer LindowsCommented:
Ahhh ok i get it. Right can be modified and should replicate from right to left during the mirror. Nice! Didnt think of that.
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
Windows Server 2008

From novice to tech pro — start learning today.