stephenlecomptejr
asked on
Help with command line that was built to copy files if changes were done.
Please note the following command line:
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?
robocopy "\\network path" "C:\local path" /s /e /r:0 /z
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Mirror is the option I think you are looking for, as in:
robocopy "\\network path" "C:\local path" /mir /r:0 /z
~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:
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
ASKER