[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5598
  • Last Modified:

Robocopy commands

Hi there,

Please can someone tell me if I have the correct robocopy commands for what I want to do.  Basically I want the source destination to be the master and NOT to be affected in anyway and i need robocopy to update the destination folder to bring it inline with the source folder.  I have the following command:

robocopy "\\source file" "\\destination file" /COPYALL /B /SEC /MIR /R:10 /W:1 /Tee /LOG+:e:\remote-backup-log.txt
technix-rcopy.txt
0
philipgecko
Asked:
philipgecko
  • 3
  • 2
1 Solution
 
rynoxCommented:
Looks pretty good, although I would make a couple of minor chages:

Get rid of the /SEC, /COPYALL covers this for you
Change /Tee to /TEE, not sure offhand if RoboCopy is case sensitive in its switches or not, but better safe than sorry.
0
 
philipgeckoAuthor Commented:
and this will definately not affect the source file..?
0
 
rynoxCommented:
No it won't , will just be doing copying, nothing will change on the source.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
philipgeckoAuthor Commented:
ok thx
0
 
reswobslcCommented:
Of course you probably know this, but for the benefit of any newcomers to this thread, here is a warning:

The /MIR command line option will DELETE any file in the destination directory that isn't present in the source directory.  The job of /MIR is to make Destination look just like Source.  So if Source contains three files A,B,C and destination contains A,B,D, then /MIR will copy C and then permanently delete D.
0
 
rynoxCommented:
Hey philipgecko,

Did everything work out for you?

If everything is good, you should probably close this and assign points, if not we may be able to help you more.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now