Robocopy parameters.

nav2567
nav2567 used Ask the Experts™
on
Hello,

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.  

Thanks.

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

Weekly Miirror job
ROBOCOPY \\sourceserver\share \\destserver\share /s /e /mir
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Datacenter platform engineer Lindows
Commented:
Hi

/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

Cheers

Author

Commented:
Thanks.  So, Robocopy \\SourceServer\Share \\DestinationServer\Share /e will copy only differential by default?
Shaun VermaakTechnical Specialist
Awarded 2017
Distinguished Expert 2018

Commented:
Always include /XO so that if destination is updated, source do not overwrite it
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Patrick BogersDatacenter platform engineer Lindows

Commented:
Yes.

Shaun, why exclude older files(/xo)
Shaun VermaakTechnical Specialist
Awarded 2017
Distinguished Expert 2018
Commented:
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 Lindows

Commented:
Ahhh ok i get it. Right can be modified and should replicate from right to left during the mirror. Nice! Didnt think of that.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial