PLEASE NOTE: This article may be missing some images or have miniature or blurred images.
We are aware of this problem and are working to correct this as soon as possible
(Robocopy is a product from Microsoft - http://www.microsoft.com/)
Using Robocopy (Robocopy.exe: Robust File Copy Utility) to synchronize server contents on a scheduled basis.
First download and install Robocopy from http://www.microsoft.com on both of your servers.
You can use ROBOCOPY, a Microsoft resource kit tool, to keep your files replicated on two or more servers. You need to have a direct connection to both the source- and destination servers.
You can run ROBOCOPY in many ways. If you prefer, you can run it from a command prompt, or from a batch file, or via a scheduled task.
Download the zip-file and extract the two files and save them into, for example, the SYSTEM32 folder on your computer. The zip file includes the tool itself and the complete explanation and documentation to all the switches.
The easiest way to use ROBOCOPY is to run the following command:
ROBOCOPY \\sourceserver\share\path \\destinationserver\share\path /MIR
Or
ROBOCOPY source-drive:\path destination-drive:\path /MIR
/MIR is an option to ROBOCOPY where you mirror a directory tree with all the subfolders including the empty directories and you purge files and folders on the destination server that no longer exists in source.
Example
You add a file "KYOTO-file.html" to the directory "webdir" on the server "kyoto". You also delete another file "DALLAS-file.html" on the server "kyoto".
The files have to be synchronized between the two servers. The "KYOTO-file.html" file is copied to the "dallas" server and the file "DALLAS-file.html" is deleted from the "dallas" server because it is no longer in the "webdir" directory on the "kyoto" server.
The result of the ROBOCOPY command is displayed in the following figure:

The servers are now fully synchronized.
Scheduling
You can also schedule the file replication instead of running it manually. Before you can use this option you must prepare your system.
Create a new file on the Kyoto server with - for example Notepad, containing one line:
robocopy.exe \\kyoto\webdir \\dallas\webdir
Save the file. Choose a describing name for the file - for example:
kyoto-dallas.cmd
Create a new scheduled task. Open Start, Control Panel, Scheduled Tasks, Add Scheduled Task.
Click the Next> button to continue.

Browse for the file you just created.

Select the directory and highlight the file and click the Open button.

Select how often you want to run the CMD-file. In this example we want to make the file replication process once every day. Click the Next > button to continue.

Select the start time when your command should be performed. It is advisable to select off-hours if possible.

Enter the user name of a user with the necessary access rights to both servers and the corresponding shares where the files you want to replicate are located. It is good idea to use an account with rights that is limited to only the appropriate directories.

Select the option Open advanced properties for this task when I click Finish and click the Finish button to continue.

Enter additional information about this task in the Comments field. Click the OK button to finish the configuration of the scheduled task.

Article ID: 5, Created On: 2/12/2013, Modified: 2/12/2013