fireguy1125
asked on
Robocopy Deleting Files at Destination
I'm copy user documents from another company provided on USB drive to the user's home folder in my company. The user has been creating folders and files in the destination location, but when I run the robocopy job, it deletes all of these files and folders, and replaces them only with what I have on the USB drive. Please advise which parameters I should change to prevent his from occuring:
robocopy "F:\Documents\User1" "\\fileshare\User\Personal \User1" /MIR /COPY:DATOU /DCOPY:T /R:1 /W:1 /XO /LOG:F:\User1log.txt
Can I just add the /XX parameter, to exclude the extra files? That is what is being logged that there are Extra directories and files.
Do I use in conjunction with the /XO parameter?
Thanks in advance!
robocopy "F:\Documents\User1" "\\fileshare\User\Personal
Can I just add the /XX parameter, to exclude the extra files? That is what is being logged that there are Extra directories and files.
Do I use in conjunction with the /XO parameter?
Thanks in advance!
Remove /MIR
ROBOCOPY has a lot of important options, make sure you read carefully:
https://technet.microsoft.com/en-us/library/cc733145.aspx
~bp
https://technet.microsoft.com/en-us/library/cc733145.aspx
~bp
ASKER
I removed /MIR, but now it's not copying anything.
ASKER
It seems to be working by using:
robocopy "F:\Documents\User1" "\\fileshare\User\Personal \User1" /MIR /COPY:DATOU /DCOPY:T /R:1 /W:1 /XO /XX /LOG:F:\User1log.txt
I only added the /XX, and folders and files that already existed in the destination were kept intact.
Are there any unforseen issues with using the above command?
robocopy "F:\Documents\User1" "\\fileshare\User\Personal
I only added the /XX, and folders and files that already existed in the destination were kept intact.
Are there any unforseen issues with using the above command?
I would replace /MIR and /XX with just /E. Seems more logical.
~bp
~bp
ASKER
Thanks, i'm not following what the difference would be between the two:
robocopy "F:\Documents\User1" "\\fileshare\User\Personal \User1" /MIR /COPY:DATOU /DCOPY:T /R:1 /W:1 /XO /XX /LOG:F:\User1log.txt
robocopy "F:\Documents\User1" "\\fileshare\User\Personal \User1" /E /COPY:DATOU /DCOPY:T /R:1 /W:1 /XO /LOG:F:\User1log.txt
robocopy "F:\Documents\User1" "\\fileshare\User\Personal
robocopy "F:\Documents\User1" "\\fileshare\User\Personal
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Bill!
Welcome, glad that helped.
~bp
~bp
~bp