Subscribe

Get the Network Administrators tool pack

Subscribe to our newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them.

Click Here to get your free tools

Recent Posts

Search

Archives

Robocopy is an administrators best friend

by Steve Wiseman on January 6, 2006 · 2 comments

in Windows


.

I am not sure if you have heard of it. Robocopy. It is a free command line utility that has been included with the NT line of windows for some time now. I actually think all the way back to NT 4.0. It is usually in the resource kit. This tool has saved me tons of time over the years. It essentialy lets you do a file synchronization between windows PCs. Perfect for when you need to copy gigs of data over the wan, but need something that will keep retrying until the job is done.

Lets say you want to copy the contents of c:\data to a network folder e:\data, but only want to retry 5 times if the copy is failing on any individual file:

robocopy c:\data e:\data /r:5

The above will only copy the root folder, not any subdirectories. To include all subdirectories use the /s switch:


robocopy c:\data e:\data /s /r:5

Now one problem I always run into is that I will have a ton of little files that are failing for one reason or another. They are usually log files that are in use and I don’t care about them. To get the wait time between failures short and sweet then use the /w option. It tells it the number of seconds to wait between failures:

robocopy c:\data e:\data /s /r:5 /w:1

Now you are scratching your head, and think to yourself: “How is this different from xcopy – other than these retry and wait functions?”

It only copies the folders and files it sees as *new*. If you copied 1.2 GB of folder c:\data, and it got cut out in the last few files – you can call up robocopy and it will only copy the files that are newer, or do not exist on the remote side.

At the end of a copy it will give you a report. It lets you know how many files and folders were copied, and how many errors.

One of these days when I am in a programming mood I might throw together a GUI for those that find the command line interface too hard to understand ;()

If you don’t have the resource kit, you can download a copy of robocopy here (Note: It only works on 2000, XP, NT, 2003, and Vista systems – no 98/95/ME sorry!)

One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools

Related Articles:

{ 2 comments… read them below or add one }

1 Roger Emerick May 14, 2010 at 2:22 pm

I just downloaded and was trying robocopy. I did some simple tests. One thing I discovered is if I copy from a source to a destination with a /E; then I update a file in the destination; then I do another copy from source to destination with /E, it will overwrite the updated destination file with the older source file. Is there a way to prevent replacing a newer version of the file. I reviewed the robocopy doc but I can’t find it. Thank you.

2 Steve Wiseman May 18, 2010 at 8:16 am

It should not do that. The only thing I could think of is that the date and time stamps on the computers are different….that is what RoboCopy uses to determine if it should copy over the file (I believe that and the size of the file)

Leave a Comment

Category Links - Windows Forum - Exchange Forum