Link to home
Start Free TrialLog in
Avatar of stephenlecomptejr
stephenlecomptejrFlag for United States of America

asked on

Help with command line that was built to copy files if changes were done.

Please note the following command line:

robocopy "\\network path" "C:\local path" /s /e /r:0 /z

Open in new window


It is supposed to copy over the file if there have been changes and erase over it if it exists at its destination!
Is this correct?
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stephenlecomptejr

ASKER

thanks.   what should be the syntax to mirror then?
Avatar of Bill Prew
Bill Prew

Mirror is the option I think you are looking for, as in:

robocopy "\\network path" "C:\local path" /mir /r:0 /z

Open in new window

~bp
/mir will do that; it includes "/e".
This will obviously delete files in the target; a useful option to test what would happen is "/L", which will only list the files that would be copied, but not actually do anything.
So anything the following command would list as *EXTRA would be deleted in a full run:
robocopy.exe "\\network path" "C:\local path" /mir /r:0 /z /L

Open in new window