Scott Hanselman

XCopy considered harmful - Robocopy or XXCopy or SyncBack

August 5, '07 Comments [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 twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Sunday, August 05, 2007 1:51:59 AM UTC
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.
Sunday, August 05, 2007 2:34:50 AM UTC
filesync http://www.fileware.com/products.htm
Use it to deploy to our servers all the time.
Sunday, August 05, 2007 3:10:26 AM UTC
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.
Sunday, August 05, 2007 3:20:04 AM UTC
@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.
Sunday, August 05, 2007 3:51:17 AM UTC
Love them all. Unfortunately, all these tools are subject to Vista's "Calculating time remaining" insanity.
frizzo
Sunday, August 05, 2007 5:13:50 AM UTC
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.
mind
Sunday, August 05, 2007 5:26:52 AM UTC
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.
michael
Sunday, August 05, 2007 6:36:08 AM UTC
unison

ifolders

powerfolders

rsync (deltacopy)
malcontent
Sunday, August 05, 2007 8:58:40 AM UTC
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.
Andrew
Sunday, August 05, 2007 10:40:46 AM UTC
Anyone know if any of these tools are particularly friendly towards NTFS junctions?
Sunday, August 05, 2007 12:40:27 PM UTC
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...
Sunday, August 05, 2007 1:19:20 PM UTC
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.
Harry M
Sunday, August 05, 2007 2:54:39 PM UTC
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>

Rabbit
Sunday, August 05, 2007 4:55:32 PM UTC
Ya, I use Copy CON a lot and I'm shocoked how many folks it freaks out.
Sunday, August 05, 2007 7:10:00 PM UTC
I'm a XXCopy fan. Anyone who has ever tried to deploy FCKEditor knows that Explorer just doesn't cut it anymore!
Sunday, August 05, 2007 8:46:47 PM UTC
I second that Synctoy is super easy, fast and works for me.
Sunday, August 05, 2007 10:31:23 PM UTC
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?
Monday, August 06, 2007 3:51:47 PM UTC
Very timely post (as usual)! I'm working on a file sync project today.

Thanks, everyone!
Tuesday, August 07, 2007 9:54:50 AM UTC

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 ...
Tuesday, August 07, 2007 1:21:25 PM UTC
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...
Tuesday, August 07, 2007 4:42:22 PM UTC

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.
abdu
Tuesday, August 07, 2007 5:38:54 PM UTC
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.
Tuesday, August 07, 2007 10:12:39 PM UTC
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.

Lucas Krause
Tuesday, August 07, 2007 10:44:35 PM UTC
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.
Wednesday, August 08, 2007 6:46:59 PM UTC
Nobody mentioned Total Commander, so I will: http://www.ghisler.com/
Peter
Saturday, August 11, 2007 6:36:23 PM UTC
I use "cp -r" which is available as part of either Unix Utils (lean and mean) or cygwin (winux).
Saturday, September 01, 2007 2:53:37 PM UTC
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/
Monday, September 10, 2007 10:55:30 AM UTC
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.
Clive
Monday, September 10, 2007 12:29:27 PM UTC
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 :-)
Friday, September 14, 2007 10:42:54 AM UTC
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
localboy
Friday, September 14, 2007 10:44:43 AM UTC
Make your own searchable robocopy help file:
From command prompt run:

robocopy /? >roboHelp.txt
localboy
Monday, October 01, 2007 10:20:12 PM UTC
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.