0
votes

I would like to copy multiple sources to one destination.

Unfortunately, robocopy always deletes files in the target folder when a new line comes up!

Example, Source is folder A, B and C. First line copies files from folder A to D. Then second line copies files from folder B to D. The third line copies from folder C to D. On completion, D only lists the files from C.

Here are my robocopy commands:

robocopy \\serverX\strawberry\400_IT\10_Partner \\\serverY\t$\test12000_Partner\1220_Partner Companies\ *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\400_AR_10_Partner.log
robocopy \\serverX\strawberry\400_IT\11_Forge \\serverY\t$\test4000_Forge\4300_AR_Forge *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\400_AR_11_Forge.log
robocopy \\serverX\strawberry\400_IT\1_sourcing \\serverY\t$\test4000_forge\4300_AR_forge *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\400_AR_1_sourcing.log
robocopy \\serverX\strawberry\400_IT\20_structure \\serverY\t$\test1000_structure\1030_AR_structure *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\400_AR_20_structure.log
robocopy \\serverX\strawberry\400_IT\21_REM \\serverY\t$\test4000_forge\4300_AR_forge *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /log:c:\temp\400_AR_21_REM.log
robocopy \\serverX\strawberry\400_IT\22_Linzer \\\serverY\t$\test1000_structure\1030_AR_structure *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\400_AR_22_Linzer.log
robocopy \\serverX\strawberry\400_IT\30_AR_Help \\serverY\t$\test000_staff requests\010_instructions *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\400_AR_30_AR_Help.log
robocopy \\serverX\strawberry\400_IT\51_Worldwide pages \\\serverY\t$\test1000_structure\1030_AR_structure *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\400_AR_51_Worldwide pages.log
robocopy \\serverX\strawberry\400_IT\530_Utility \\serverY\t$\test6000_Teaching aids\6100_Licenses *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\400_AR_530_Utility.log
robocopy \\serverX\strawberry\400_IT\54_VHS_Cassette \\serverY\t$\test6000_Teaching aids\6100_Licenses *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\400_AR_54_VHS_Cassette.log
robocopy \\serverX\strawberry\800_Pre-Flood \\serverY\t$\test4000_Forge\4200_Forge_Strawberry *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\800_Pre-Flood.log
robocopy \\serverX\Strawberry\Company One-Other Power\Money \\serverY\t$\test4000_Forge\4200_StrawberryForge *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\Company One-Other Power_Money.log
robocopy \\serverX\Strawberry\Company One-One Power\Insight \\serverY\t$\test2000_One-One Power\2100_IT\Insight *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\Company One-One Power_Insight.log
robocopy \\serverX\Strawberry\Company Others Power\Portfolio \\serverY\t$\test4000_Forge\4300_AR_Forge *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\Company Others Power_Portfolio.log
robocopy \\serverX\Strawberry\company One-One Power\SALO_Uri_casa \\\serverY\t$\test1000_structure\1010_Milky Way *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\company One-One Power_SALO_Uri_casa.log
robocopy \\serverX\strawberry\company otherness_rolls \\serverY\t$\test4000_forge\4300_AR_forge *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\company otherness_rolls.log
robocopy \\serverX\Strawberry\Company One-Other Power\AR_Flood Inflow \\\serverY\t$\test4000_Forge\4200_StrawberryForge *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\Company One-Other Power_AR_Flood Inflow.log
robocopy \\serverX\strawberry\Plate \\\serverY\t$\test1000_structure\1030_AR_structure *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\Plate.log
robocopy \\serverX\strawberry\forge \\serverY\t$\test4000_forge\4300_AR_forge *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\forge.log
robocopy \\serverX\strawberry\help \\serverY\t$\test80000_customerhelp *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\help.log
robocopy \\serverX\strawberry\Sagmal \\serverY\t$\test14000_Sagmal *.* /MIR /MT:3 /R:3 /w:15 /np /DCOPY:T /A-:HS /log:c:\temp\Sagmal.log

Any solutions?

1
Please format the post. - Jetchisel
Thxs @ArchNoob for formating the post 👍🏻 - F0x Mu1d3r
robocopy backed me up and saved me more times than I can remember, this is the least I can do to the community. You're welcome! ✌️ - ArchNoob
Well, you tell robocopy to delete extra files in the destination since you specified /MIR... - aschipfl
Hi aschipfl. Ok 😳 what is the better solution? /E and delete the argument /MIR? - F0x Mu1d3r

1 Answers

1
votes

/MIR always removes any files which are "extra" in the target folder in order to make the target folder look exactly the same as your source folder (hence the name "Mirror"). In fact, contrary to the name of the command robo copy deletes files and folders in MIRror mode which can turn out devastating when "copying" to existing destination directories!

If you just want to add files to a directory use /E and maybe /XX instead of /MIR for a "really copy only" mode. The first switch tells robocopy to just copy files and empty directories and the latter would skip any extra files and folders from being processed at all.
I like to put an /XX to have a cleaner log file. With this the *EXTRA files are not listed. Which in turn should give a little bit of a speed improvement since they are not printed to console nor to logfile.