Subscribe to Windows IT Pro
November 15, 2004 12:00 AM

Robocopy XP010 FAQ

Wield powerful new switch options
Windows IT Pro
InstantDoc ID #44324
Rating: (6)
Downloads
44324.zip

Robocopy is one of my favorite and most frequently used Microsoft Windows Server 2003 Resource Kit tools. The new version of the utility—Robocopy XP010—has added several features that I've recently been exploring. Based on reader questions that I've received about this new version, I've put together a list of FAQs that might serve as valuable instruction about Robocopy. Let's start with one that addresses migration concerns you might have about moving data onto Network Attached Storage (NAS) devices.

I'm migrating a large amount of data from a Windows 2000 Server system to a new NAS environment. I'm using Robocopy with switches I've used in the past for Windows-to-Windows migrations. However, my copy times don't seem to be improving with subsequent incremental copies. What am I doing wrong?

Typically, after you perform an initial Robocopy copy run of data, you should see copy times drop because you're copying only the changes that happened since the previous copy run. The amount of data turnover, including newly changed or deleted files and folders, will vary depending on your environment.

If the share is relatively inactive and little change is occurring in the data, copy times will drop dramatically after the initial run because Robocopy has few changes to deal with. If the share is very active, with files (e.g., users' .pst mail files) that are constantly changing, you might see only a slight drop in the copy time because the share contents are experiencing a high rate of data turnover. Eventually, you'll get down to a time that represents the minimum time Robocopy needs to scan through the source and destination and check for changed files.

If you aren't seeing a drop in copy times, there are two possible explanations. You could have a highly dynamic data area that's experiencing a high percentage of change, or you could have a comparison problem in which Robocopy believes changes have taken place and recopies files when, in fact, no changes have occurred.

If you're dealing with a Windows-to-NAS copy task, you need to check with the NAS device vendor to determine whether your device supports NTFS file-time standards. Robocopy's /FFT switch is particularly helpful if you have a NAS device that doesn't support NTFS's 100-nanosecond granularity and might use the FAT file system's 2-second granularity. Rounding the NTFS file times might result in the copying of files that are unchanged; Robocopy senses these files as newer or older and copies them.

The /FFT switch forces Robocopy to use the FAT file-time granularity so that the utility uses a 2-second standard for comparing files. As long as files are time-stamped within a 2-second interval, Robocopy considers them identical and doesn't copy them. This switch option can dramatically reduce your copy times and minimize copying of files that haven't actually changed.

My company has a remote location that's connected by a slow link. Users are complaining that accessing the main corporate file server over the link is too slow. They want us to place a read-only copy of the file-server data at the remote site. I need to set up a script to copy data across the slow link. The process would need to be continuous because changes are always in progress. Can I use Robocopy for my task?

A new item in Robocopy XP010 is the Monitor feature, which you control with the /MON:n and /MOT:m switches. The /MON:n switch specifies the minimum number of changes that must occur before Robocopy runs again. The /MOT:m switch specifies the minimum time, in minutes, that must elapse before Robocopy runs again. For more detailed information about the Monitor feature, see the resource kit's Robocopy.doc Help file.

Typically, Robocopy terminates after it runs through a specified source folder location. The Monitor feature puts Robocopy into a continuous mode, causing it to continuously scan the source location for changes. You can use this new feature in two ways. The first way, which addresses your query, is to continuously replicate data to a remote location. The second way is to copy the data to a new location in preparation for a migration rather than perform periodic Robocopy runs.

If you plan to use the Monitor feature, you have one consideration to keep in mind. If you launch Robocopy in Monitor mode from a script, Robocopy might continue running after your script has terminated. To solve that problem, I use Task Scheduler to launch Robocopy in Monitor mode. Here's a sample of the command string I use in Task Scheduler:

C:\robocopy.exe"\\SourceServer  SourceShare""\\DestServer  DestShare" /COPY:DAT /E /NP  
  /FFT /NS /NDL /MON:1 /MOT:1 
  /IPG:5 /PURGE/R:1 /W:1 
  /LOG+:C:\RoboLog.txt

(Be sure you type the entire command on one line.)

If you're dealing with slow links and you're receiving Robocopy copy errors, try the new version's Inter-Packet Gap (/IPG:n) switch. I've used this switch with a value of 5 on a slow link, and it significantly reduced copy errors caused by network timeouts. See the Robocopy.doc Help file for details about the /IPG switch.

We're migrating several hundred file shares to another server location. We're concerned that Robocopy might overlook a share that exists on the source server and not create it on the destination server. How can I be sure that good correspondence exists between the source and destination servers?

The TestShareCorrespondence.bat script in Listing 1 uses the resource kit utility Rmtshare to compare shares on the source and destination servers. Rmtshare is actually a Microsoft Windows NT 4.0 Resource Kit utility that more recent resource kits haven't offered. However, the tool works fine and is still available through FTP from Microsoft at ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/rmtshare.exe.

I tested TextShareCorrespondence.bat and the other scripts discussed in this article on Windows XP Service Pack 1 (SP1) and Windows 2000 Server SP3 PCs. To use the scripts in your environment, configure the input and output file and utility locations as each script's header explains.

Column-width limitations in this publication might introduce line-wrap problems if you type the script code as it appears in the listings. I recommend downloading the actual .bat files from the Windows Scripting Solutions Web site, http://www.windowsitpro.com/windowsscripting, InstantDoc ID 44324.

Related Content:

ARTICLE TOOLS

Comments
  • Kevin
    4 years ago
    May 12, 2008

    Yeah! If I pay next to nothing for one excellent product, I should get all there other products for free! It's almost like Penton is trying to make a profit or something. GO figure! What happened to IT wellfare?

  • Benjamin
    5 years ago
    Sep 01, 2007

    I agree with Kris and Scott and completely disagree with Joe finding his opinion to be somewhat condescening and plainly flying against the grain in that we have already paid hard earned money for what!?!

    To give you more hard earned money?

    I and --sounds like others too-- will be going down the roadl

    Have fun with your Penton pub Joe! I'll be find a new pub with a better happy hour, and cleaner taps!

    I.e. the popups and adverts on this site couldn't be more annoying!

  • Joe
    6 years ago
    Nov 07, 2006

    What both of you need to realize is that you don't subscribe to the Scripting newsletter. Just because you subscribe to the WindowsITPro magazine doesn't mean you should have the right to view any of the Penton media publications.

  • Scott
    6 years ago
    Oct 26, 2006

    I Agree with Kris. I am a WindowsITPro Subscriber, and frankly I am dissapointed that every time I need to search for a solution I find that the money I spent was a waste because I need ANOTHER subscription to read the article I need.

  • Kris
    6 years ago
    Sep 05, 2006

    This is really a bunch of BS. i was trouble shooting a problem when i found a potential fix on windows IT pro - but i couldn't look at it until i subscribed. Now i am looking for robocopy info and find this Robocopy XP010 FAQ
    article - which says "want to read more just pay another 79.00 for the scripting newsletter. What kind of crap is this - i don't think you'll be getting repeat business from me. If you have anything to say about this please email me a kris.viehe@wamu.net

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.