Robocopy is one of the many multipurpose utilities in the Microsoft Windows Server 2003 Resource Kit (it is based on a powerful copy program

Source: Internet
Author: User
Tags naming convention robocopy

Robocopy is one of many multipurpose utilities in the Microsoft Windows Server 2003 Resource Kit (it is based on a powerful copy program). Yes, Robocopy's function is to copy files, you may be bored and go through the next article, wait, let's give this interesting little program a chance. Robocopy is capable of handling replication operations including large chunks of data, and it allows you to identify technical specifications such as copy and Xcopy, as well as other copy programs. Explain, for example, that you can use Robocopy to copy a complete directory tree, not just the three layers under the tree. You can also specify that the robocopy will not exceed the One-third resources that use network bandwidth during the operation of the network copy, and so on. If Robocopy has any shortcomings, it is its grammar. The Robocopy.doc document in the Resource Kit does not have some really useful content beyond explaining its syntax with such a lengthy 32 page number. So let's analyze it thoroughly and pick out some basic syntax for robocopy.

Robocopy Foundation

As can be seen from the simple expression of robocopy, it has subtle similarities with other command-line copy tools: Robocopy <source directory> <destination directory>< Filenames> <options> If I want to copy all the files from the C:\stuff directory to the C:\stuffbak directory, I should type: Robocopy C:\stuff C:\stuffbak so far, Not bad. It looks like the operation of a copy or Xcopy program. But what if I just want to copy the text file with the "s" at the beginning of the file name? In xcopy I should type as follows: xcopy C:\stuff\s*.txt C:\stuffbak However, the syntax in Robocopy is not feasible. Instead, combine the source directory with the destination directory and add file types and filters. For file types and filters, Robocopy is implemented in a separate location. So for the above text file copy, you should type: Robocopy C:\stuff C:\stuffbak s*.txt

Web applications

So far, I've enumerated copy instances of the source and destination directories, but they are just operations based on the local file directory, and Robocopy can handle the operation of Universal Naming Convention (UNC) names. Example: Robocopy \\marksws\myfiles \\centralserver\marksfiles

This command will copy all files from the shared directory myfiles the MARKSWS computer to the Marksfiles directory shared by the Centralserver computer via the network. Such a feature might be useful, but when we join the hybrid application of the network, we need to consider the problem of network reliability. Any network copy operation can be interrupted by many potential network problems. In many practical applications, network problems will soon be purged by itself. Therefore, you just need to wait a short time to repeat the operation just again. But who would imagine a baby waiting for a computer to repeat the transmission of a large network file? Fortunately, when a failure event occurs, you can make robocopy automatically run the copy operation again (with the/W:XX option) by specifying a time number (in seconds), and you can also set the number of Robocopy copy work retries (with the/R:YY option) by a specified number. OK, let's set the Robocopy to make a copy of the network file for 13 retries, and 30 seconds between each retry. You should type: Robocopy \\marksws\myfiles \\centralserver\marksfiles/w:30/r:13 If you don't want to specify the wait interval or the number of retries, In theory Robocopy will use the default 1 million retries and the 30-second retry interval. A simple robocopy command can even take a year to complete a copy operation in a very bad network environment (of course this is not what I actually want to try). Sometimes, the work of a network copy fails for a simple but annoying reason. For example, you may not have read access to all the files that are being copied. (This is the case when you try to back up a user's profile or home directory.) If you need to back up some files without NTFS Read permissions, check that you have backup permissions for the files--remember, read permissions and backup permissions are not the same thing. If so, you can use the Robocopy/b or/ZB option to back up your files. The/b option is to make robocopy use Backup rights Backup, and the/ZB option is to make it first try the standard copy operation, and then copy it with backup permissions after the failure.

Just the beginning.

The purpose of this paper is to introduce Robocopy donuts. You can also take a look at the online documentation

Robocopy is one of the many multipurpose utilities in the Microsoft Windows Server 2003 Resource Kit (it is based on a powerful copy program

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.