Monday, February 05, 2007

MS: Robocopy

My favorite tool in the entire world is robocopy. This is an amazing and fast tool to copy files. I'm using robocopy every day, in my day by day work, in my servers and my laptops.

I good example for a simple copy:

robocopy c:\data e:\software\data /e /r:1 /w:1

This example copy all files and directories (/e) from c:\data to e:\software\data, retries 1 time (/r:1) and wait 1 second between retry (/w:1).

robocopy file:////Server1/Data
E:\software\data /E /copyall /np /r:3 /w:1 /log+:c:\log_robocopy.txt /TEE

This example is useful to migrate all files and directories (/e) from the share \\server1\data to e:\software\data, retries 3 times (/r:3) and wait 1 second between retries (/w:1), copy all NTFS attributes and permissions (/copyall), turns off copy progress indicator (/np), redirects output to the specified file, appending it to the file if it already exists (/log+:c:\log_robocopy.txt) and displays output in the console window, in addition to directing it to the log file specified by /LOG or /LOG+ (/TEE).


You can download robocopy (included in Windows 2003 Resource Kit) here