Solved

Robocopy Deleting Files at Destination

Posted on 2015-02-11
10
118 Views
Last Modified: 2015-02-11
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!
0
Comment
Question by:fireguy1125
  • 5
  • 4
10 Comments
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
The /MIR is your problem, it is forcing the two folders to be "synced", so extra files are being deleted from the dest.

~bp
0
 
LVL 23

Expert Comment

by:NVIT
Comment Utility
Remove /MIR
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
ROBOCOPY has a lot of important options, make sure you read carefully:

https://technet.microsoft.com/en-us/library/cc733145.aspx

~bp
0
 
LVL 1

Author Comment

by:fireguy1125
Comment Utility
I removed /MIR, but now it's not copying anything.
0
 
LVL 1

Author Comment

by:fireguy1125
Comment Utility
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?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
I would replace /MIR and /XX with just /E.  Seems more logical.

~bp
0
 
LVL 1

Author Comment

by:fireguy1125
Comment Utility
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
0
 
LVL 51

Accepted Solution

by:
Bill Prew earned 500 total points
Comment Utility
They should accomplish the same result.

/MIR is equal to /E and /PURGE

/XX essentially undoes the /PURGE

so effectively they end up at the same place.

~bp
0
 
LVL 1

Author Closing Comment

by:fireguy1125
Comment Utility
Thanks Bill!
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
Welcome, glad that helped.

~bp
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now