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?

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

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 Specialist/DeveloperCommented:
Always include /XO so that if destination is updated, source do not overwrite it
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Patrick BogersDatacenter platform engineer LindowsCommented:

Shaun, why exclude older files(/xo)
Shaun VermaakTechnical Specialist/DeveloperCommented:
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.