Wednesday, December 22, 2010

Robocopy and process how to use robocopy

Robocopy (Robust File Copy) is a command-line file copying tool included with the Microsoft Windows Server 2003 Resource Kit.

Why use Robocopy?

Robocopy is designed for reliable copy or mirroring of entire folders of any size ensuring all NTFS attributes and properties are copied (except security-related ones), particularly over network connections that are subject to disruption or outages. With this we can copy the open files(Files that are in use) also.
=> Ability to copy entire subdirectories (note: XCOPY can do this, COPY can't)
=> Ability to tolerate network outages and resume copying where it previously left off (incomplete files are noted with a date stamp of 1/1/1980)
=> Ability to correctly copy NTFS ACLs, attributes, owner information, alternate data streams, auditing information, and timestamps by default, without the need for numerous oft-forgotten command line switches
=> Ability to copy large quantities of files that would normally crash the built-in XCOPY utility.
=> A progress indicator on the command line that updates continuously

Robocopy Syntax
ROBOCOPY source destination [file [file]…] [options]
/S :: copy Subdirectories, but not empty ones.
/E :: copy subdirectories, including Empty ones.
/COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU).
/ZB :: use restartable mode; if access denied use Backup mode.
EX:-
ABC and BBC are two different severs.
\\ABC\home_O$\Newfolder is the source path.
\\DBC\home_O$\Newfolder is the Destination folder.

How to use Robocopy:-
1.      Log into any one of the server.
2.      Open command prompt.
3.      Give the robocopy command and click on enter.
C:\windows> robocopy “\\ABC\home_O$\Newfolder” "\\DBC\home_O$\Newfolder” /s /b /copyall /zb /log:c:\Newfolder.txt