XCopy considered harmful - Robocopy or XXCopy or SyncBack
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.
About Newsletter
Use it to deploy to our servers all the time.
@Scott: Synctoy probably deserves an honorable mention. It's not incredibly full-featured, but it works as advertised with a minimum of effort.
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.
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>
Thanks, everyone!
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 ...
mind: welcome to the interweb. grow up...
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.
http://www.copyhandler.com/
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
From command prompt run:
robocopy /? >roboHelp.txt
Comments are closed.
It's truly the swiss army knife of compare utilities.