Robocopy is a powerful Microsoft Windows 2000 Resource Kit and Microsoft Windows NT 4.0 Resource Kit tool. This command-line tool can accomplish a variety of scripted copying tasks, including large data migrations and server consolidations. The 22-page robocopy.doc document that's installed with the resource kit tools has a complete explanation of Robocopy's more than 40 switches (more switches than in any other tool I've seen).
I covered the Robocopy tool in "Real-World Scripting: Data Migration with Robocopy, Part 1," March 2001, http://www.winscriptingsolutions.com, InstantDoc ID 19826, and "Real-World Scripting: Data Migration with Robocopy, Part 2," April 2001, InstantDoc ID 20134, and these are good reference documents for you to review before you try to use Robocopy for a large project. In addition, here are answers to some FAQs about effectively using Robocopy for major data migrations and server consolidations. These questions and answers should complement the information in my earlier articles and address queries I've received about using Robocopy.
How dependable is Robocopy? Can it fail to copy a file or group of files without logging an error?
Yes, on isolated occasions, Robocopy can fail without logging an error. When I say isolated, I mean itI've had this happen only twice in 5 years. To catch any failures, always compare the source and destination locations to ensure that the same number of files, folders, and bytes of data exist in both locations. In addition, I recommend that you log all Robocopy operations and review the logs carefully. The /Log switch syntax is
/LOG:C:\logfile.txt
which creates a new file or overwrites an existing file, or
/LOG+:C:\logfile.txt
which creates a new file or appends to a previous file.
I often send the entire log file or a summary of the copy operation results from the log file to the responsible manager or file owner to confirm the success of the copy operation. This step helps eliminate any user questions about lost or missing files.
If Robocopy fails to copy a file or folder, how does the log file display the failure?
The log file summarizes both successes and failures in a table at the end of the file. You can also search for the word EXCEEDED in the log file to locate the specific file that failed.
What can cause copies to fail?
One of three main problems can cause Robocopy to fail to copy a file or group of files. The most common situation is that you lack Read permissions on the source directory. If you aren't absolutely sure that you have Read permissions on all areas inside the source directory, be sure to carefully flow down Read permissions throughout that structure for yourself or for the account under which you're running the script.
The second most common problem is pathnames that are longer than the 255-character limit that Windows supports. If file or folder paths are 255 characters or longer, they're often difficult to copy, modify, or delete. If you're unsure whether you have 255-character paths, see "Real-World Scripting: Locating Long Paths in a Directory," January 2000, http://www.winscriptingsolutions.com, InstantDoc ID 7828. This article includes a Perl script that detects any long paths in your directory structure.
The third problem you could encounter is a filename or folder name that contains characters that Windows doesn't recognize or that's also a name reserved for a device. To see an example of this problem, try to create a file on your desktop called com1.txt. Device names such as Com1 and Com2 and printer ports such as Lpt1 and Lpt2 are reserved names and can't be used for filenames. Occasionally, one of these improperly named files mysteriously gets into a folder structure. Robocopy can't copy these files properly and logs improper file handle errors.
Prev. page  
[1]
2
3
4
next page