#1 01 Dec 2011 19:54

baptea
Member
Registered: 01 Dec 2011
Posts: 2

Robocopy and the XX Argument (Exclude Extra)

Hey, I just wanted to clarify the behaviour of the /XX argument provided by Robocopy.

The documentation on ss64.org currently reads:

An "extra" file is present in destination but not source,
excluding extras will delete from destination.

SRC: http://ss64.com/nt/robocopy.html

The documentation on TechNet reads:

Excludes extra files and directories.

SRC: http://technet.microsoft.com/en-us/libr … S.10).aspx

My reading of the ss64 page suggests that Robocopy will delete any extra files in the destination (that aren't in the source). However, the TechNet page doesn't mention that. Can anyone clarify if /XX will ever delete files in the destination?

If it does sometimes delete files, what's the difference between that and /Purge?

Many Thanks

Offline

#2 01 Dec 2011 22:16

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 1,037
Website

Re: Robocopy and the XX Argument (Exclude Extra)

I think you are right, it looks to me like the wording should be

An "extra" file is present in destination but not source,
excluding extras will NOT delete from destination.

But I just ran a couple of tests which is the only way to prove these things:

robocopy source dest /XL
works as you would expect, any new files in the source don't get copied

robocopy source dest /XX
Does not delete any "extra" files from the destination

but then neither does a simple
robocopy source dest

Perhaps the /XX switch only takes effect when mixed with other switches:

robocopy source dest /purge
Will delete "extra" files from the destination

robocopy source dest /purge /XX
Will NOT delete "extra" files from the destination, in other words the /XX switch just turns off the effect of /Purge and returns us to the default behaviour.

In a similar vein
robocopy source dest /S /mir /XX
Will copy new files and folders and will not delete "extra" files from the destination.
Which I think is just the same as
robocopy source dest /E

So based on all that I think the correct help text should be:

An "extra" file is present in destination but not source,
excluding extras will not delete files from the destination (this is the default).

Offline

#3 02 Dec 2011 10:01

baptea
Member
Registered: 01 Dec 2011
Posts: 2

Re: Robocopy and the XX Argument (Exclude Extra)

Thanks for the quick reply Simon. Excellent Website!

Offline

Board footer

Powered by FluxBB