Scott Hanselman

XCopy considered harmful - Robocopy or XXCopy or SyncBack

August 05, 2007 Comment on this post [32] Posted in Tools
Sponsored By

It's just so darn hard to copy a lot of files these days. If it's more than 1000 files or larger than a gig, I don't even try with Explorer anymore. It's not worth the angst. I used to do this:

xcopy *.* d: /s /e /z /v

But when there's not a "No to all" option, and I've got it halfway copied, I get pretty frustrated. There's a few really good alternatives...

Robocopy

First, Robocopy. If you have XP or Windows Server you can easily get this in the Resource Kits. If you have Vista, it's already in your path. That's always nice. It's Robust, indeed (hence, Robocopy) but it's legendarily unforgiving. If anything is wrong with the command line options you'll just get the help. It's so hard to use there's even a GUI Frontend you can get. However, when I want to get a directory from here to over there, I just do this (no wildcards allowed! Doh!) and it just gets there, auto skipping files that are already at the destination. It's also wonderful over an unreliable network:

robocopy "H:\Source" "z:\Dest" /S /Z

Where /s means subdirectories, and /z means in restartable mode.

SyncBack

Second, for repeatable jobs, I love SyncBackSE. It's $30, but there is a free version with less features available. SyncBack is option-ful and literally moves nearly every important piece of data in my house around weekly.

It's UI is really amazing. You create as many "profiles" as you like, as complex as they need to be, using it's very nice wizard UI. I've never had to make a profile without the wizard - it's that comprehensive.

It's a huge part of our backup strategy and it even backs up this blog via FTP. Do take a moment and download at least the trial. Profiles can be named and called via the Windows Scheduler or at the command line - that's why it's really for jobs you'll do more than once. It's a great way to deploy or backup a website, and it'll talk to FTP, WebDav, etc. It'll keep folders in sync, and profiles can be grouped and run in tandem as well. It will also backup and ZIP at the same time.

XXCopy

Last, but certainly not least, XXCOPY. It's huge. Epic even. It's even got a nice windows progress bar that pops out of the DOS Box. The Technical Reference is comprehensive to say the least. Here's a summary of the features. It'll sync directories, maintain short names, qualify by date/time, copy security info.

If you are a command-line bad*ss, this is the utility for you. You'll like it immediately because it's command line switches are mostly compatible with xcopy and Robocopy, then it adds a million more so you can tweak your copy or mirror to be most effective. There's both free and pro versions.

The author is quite bold, and even has a section on how XXCopy supersedes RoboCopy. I think I just stepped in a big pile of sassy! But, I've got to give him credit. The options are insane. XXCopy does it all. Truly. Highly recommended.

Regardless of which one you pick, just please stop using XCopy.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service
August 05, 2007 5:51
I can also recommend Beyond Compare for this; just set up a compare between the source and destination and click the "make 'em the same" button. Restarting is easy because, after all, it's a compare tool first and foremost.. the only thing you don't get is restarting files in the middle, which would only be a factor if you're copying enormous files over an unreliable network.

It's truly the swiss army knife of compare utilities.
August 05, 2007 6:34
filesync http://www.fileware.com/products.htm
Use it to deploy to our servers all the time.
August 05, 2007 7:10
There is also hobocopy, which is functionally similar to Robocopy, but makes use of the VolumeShadowService (if available (XP, Vista, 2003) to enable copying of files that are currently in use by another application.
August 05, 2007 7:20
@Dave: Holy cow... Wish I'd known about Hobo Copy sooner. Robocopy was most of my entire backup strategy before I discovered Mozy, but my big complaint with that was the lack of shadow copy support. That's freakin' sweet!

@Scott: Synctoy probably deserves an honorable mention. It's not incredibly full-featured, but it works as advertised with a minimum of effort.
August 05, 2007 7:51
Love them all. Unfortunately, all these tools are subject to Vista's "Calculating time remaining" insanity.
August 05, 2007 9:13
why does this shit make programming.reddit ? nobody doing anything interesting these days uses windows. nobody wants to deal with loads of archaic legacy cruff. paths start with /, options start with - or --, and "drive letters" are retarded. i feel sorry for you if you're stuck in that old world to pay the bills. if you want to lose your shit about paying $30 for a program to copy files in a blog post, fine. but please don't post it to reddit. the world has moved on, maybe you should to.
August 05, 2007 9:26
In Robocopy, after the source and destination folders and before the options, you can specify a list of files to copy, and you can use wildcards there. Used it for a couple of years before I noticed that in the waterfall of help text.
August 05, 2007 10:36
unison

ifolders

powerfolders

rsync (deltacopy)
August 05, 2007 12:58
Beyond Compare is IT in my world! It's part of my standard new machine installation kit (along with other must-haves like ClipMate).

I seem to remember that back in the day, I *ahem* used a serial number I "found" on the internet to activate Beyond Compare. Next time I was online, I was immediately redirected to the author's website, politely thanked for my interest, told my 30 day trial period had been restarted, gently rebuked for using a dodgy serial number, and was so impressed by this that I promptly coughed up the $ for a real license. I mean, who wouldn't eh?

Since then, there hasn't been a day that I haven't used BC several times a day. Great value.
August 05, 2007 14:40
Anyone know if any of these tools are particularly friendly towards NTFS junctions?
August 05, 2007 16:40
I'm using the free version of SyncBack as it offers all the features I need to backup my files to a server. It does the job well but doesn't copy files currently in use. Besides, the tool eats all system resources when scanning for changes. I wish they'd fix these two issues...
oo
August 05, 2007 17:19
Robocopy has a frustrating return code which returns things above 0 even when the copy was technically successful, which is annoying for writing some scripts. I wish I could override to a simple 0 or 1.
August 05, 2007 18:54
While I don't think I'll run right out and change hundreds of my scripts just because Scott found a new toy, it's nice seeing an article on a fundamental topic. I was using "copy con myfile.txt" one afternoon when on of our twenty-something developers was amazed you could compose a script, file, whatever that way. We need more of these and less Microsoft hyperbole from our community.

BTW, read the Robocopy.doc! HarryM mentioned the return codes. They are
:

<ul>
<li>16 Serious error</li>
<li>8 Some files or directories could not be copied</li>
<li>4 Some Mismatched files or directories were detected</li>
<li>2 Some Extra files or directories were detected</li>
<li>1 One or more files were copied successfully</li>
<li>0 No errors occurred, and no copying was done</li>
</ul>

August 05, 2007 20:55
Ya, I use Copy CON a lot and I'm shocoked how many folks it freaks out.
August 05, 2007 23:10
I'm a XXCopy fan. Anyone who has ever tried to deploy FCKEditor knows that Explorer just doesn't cut it anymore!
August 06, 2007 0:46
I second that Synctoy is super easy, fast and works for me.
August 06, 2007 2:31
I've been using Second Copy for years (it's now version 7.0), and it's been great, for the most part. Very simple, but mainly does what I need., although a couple of people strongly recommended I look at SyncBack for a couple of years now, to compare them. They never had any specific reason -- just stated that I "should". Can anyone mention a benefit of one over the other off the top of their head?
August 06, 2007 19:51
Very timely post (as usual)! I'm working on a file sync project today.

Thanks, everyone!
August 07, 2007 13:54

Funny, I was using XCopy over the weekend to copy a HUGE amount of data, there was a power fluctuation which necessated my restarting the process, needless to say I was cursing XCopy inability to restart the copy ... doh!

Could have used XXCopy just then ... thx for the information ...
August 07, 2007 17:21
I've been using ViceVersa for years. It's part of my new server/workstation build. Check it out if you're comparing programs and averse to command lines :)

mind: welcome to the interweb. grow up...
August 07, 2007 20:42

So which tool is the most comprehensive? Every time I read a post of which tool people use, everyone mentions their favorite tool and I end up with a list of every similar tool on earth.
I wish there are comparison reviews for software in every category so one can make a good decision.
August 07, 2007 21:38
Abdu - I'd say in this case, xxcopy is pretty amazing, but I believe there are is no right answer. Each tool has a reason for existing. I use all three of these.
August 08, 2007 2:12
Many of these copy routines are not junction safe, which is another consideration. I am not sure which are, but I know robocopy isn't, and xcopy isn't, but not sure about the others. Do we have anything that compares to a tar/gzip in *nix environments? I mean even compresstion on the transfer would be good, with encryption as well, similar to copying/backing up over SSH , and Secure copy, i wish we had these.

August 08, 2007 2:44
Lucas - Both xxcopy and robocopy have junction options that make them save, like /xj for exclude junctions. I believe xxcopy can also optionally bring the junction along for the ride.
August 08, 2007 22:46
Nobody mentioned Total Commander, so I will: http://www.ghisler.com/
August 11, 2007 22:36
I use "cp -r" which is available as part of either Unix Utils (lean and mean) or cygwin (winux).
September 01, 2007 18:53
For a non-command-line method of copying files and handling errors with "ignore", "ignore all", "cancel", etc. type of functionality (vs. Windows' all-or-nothing approach where the process ends at the first error), try CopyHandler. Has pause/resume functionality (even between reboots), threading, etc. Open source, too.

http://www.copyhandler.com/
September 10, 2007 14:55
You forgot to mention secure copy. It's definitely the best copying solution from my experience. If you have any doubts I would take a look at this comparison with other tools.
September 10, 2007 16:29
For me, I go with Foldershare to copy around a load of data between all of my machines. Also for people who don't particularly want to use the command-line :-)
September 14, 2007 14:42
Robocopy by default supports wildcard copying...hence no reason to add *.* or similar in the basic syntax.

Robocopy also allows you to specify which files/folders to include/exclude from the copy process. Check the /XF and /XD switches. You can even specify file sizes as an additional copy criteria.

Other features include:
Copying with Restartable Mode
Error handling for files that are inuse at the time of copy
Mirroring
Folder Monitoring
AND its best feature...the logging reports.

Robocopy..the best thing since ... Norton Commander
September 14, 2007 14:44
Make your own searchable robocopy help file:
From command prompt run:

robocopy /? >roboHelp.txt
October 02, 2007 2:20
I believe NTFS junctions are going obsolete.
JQS

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.