Wednesday, August 26, 2009
Robocopy trumps RichCopy
Microsoft has released a new replacement for Robocopy. What's Robocopy you ask? Only about the best way to copy a lot of files across a network via the command line in Windows.
Robocopy will copy a directory with any amount of files and subdirectories. It will merge the contents of the directories if duplicates already exist in the destination depending on options you pass it. If a file cannot be read, it will pause and retry a certain number of times, and if you lose your network connection during the copy, when your connection is back, you can reissue the same command, and it will pick up where it left off, not recopying the files it already copied.
It's a really great command line tool and I wish drag and drop copying in both Windows and Mac OS X behaved like this instead of failing miserably if the network drops or wiping destination directories out even if they contain different files from the source.
Robocopy is great. It's one of the first things I install on a freshly formatted Windows box.
So what could be better then Robocopy? According to Microsoft TechNet, RichCopy. RichCopy is the next generation Robocopy adding an easy to use GUI and performance enhancing multithreaded copying (so it can move more then one file at a time which reduces network lag if you are moving a lot of small files.)
So today I installed RichCopy and put it to the test. I needed to move a directory that had 19.8GB in 69,510 files and 13,654 directories (or folders if you prefer.) I started RichCopy and used its GUI interface to start the copy. My network performance was only about 10Mbps (I'm on gigabit people) but it's an overworked corporate network, so I don't think that's any fault of RichCopy. Unfortunately about an hour and 45 minutes into the job, the server disappeared from the network for a second. No problem, right? That's the kind of thing RichCopy was made to handle. Unfortunately at that point RichCopy crashed with an exception, and the only option was to close the exception dialog which closed the RichCopy application.
So now I've got Robocopy doing the copy. It doesn't have a fancy GUI but it's working.
Oh BTW, there is also a GUI for Robocopy here. But I tried it and it had at least one bug (back when I tried it.) It may work for you, but, if you are looking for a robust copy tool, chances are you can handle the command line anyway.
Here's something to get you started on Robocopy:
robocopy source destination /S
By default robocopy won't copy files that appear the same so it always performs a merge and that's what this command line will to. The /S says to be recursive but don't copy empty directories.
The Wikipedia entry on Robocopy covers all the optional parameters.