Free, Windows File System Replication

In the hosting industry we are often presented with problems needing solutions that demonstrate intelligence and cost effective savings without any compromises.
The confidence in this is demonstrating as an expert we have an understanding of what hardware technology suits a given solution and how that solution works, what are the instructions.

In a marketing seminar I once heard more you spend the less you know the less you know the more you spend.

There are factors in this however where the rules don’t always apply this same way.
A hardware manufacturer solution is backed up by the guarantee and for insurance this is generally a more comforting level for which we can sleep at night.  That does not go to say other methods don’t get the job done, it’s just a basis on the cost factor as to when you want to apply dollars to process.  Whether its investment in people, equipment or a guarantee.

Competitive bidding wars in the hosting industry, contending for the RFP and delivering capability the end results are from a paper perspective decided on what looks best on it, usually it is cost and guarantee.

A common problem and solution is that a customer is looking for redundancy between multiple servers on the file system layer and they are looking for a solution which does not add all of the costs of a enterprise storage system.

The scripts come out and today we talk about Robocopy, a free product and solution built into the Windows Operating System for some time now, we have had a tremendous amount of confidence and success in the commanding function.  Not even just my advocacy for Robocopy but I have multiple commentaries from Microsoft staff employees themselves whom work in the Windows Server department at Microsoft whom also speak out that Robocopy is way more successful than even some of the more complex software replication technologies including those others designed in house at Microsoft.

Robocopy is a command line function run from DOS shell that operates using syntax and variable switches.  You tell it what you want to do, where you are copying (replicating) from and where you will copy to (mirroring).  Here is the command we are going to demonstrate, we will follow with explanation of them.

Robocopy “D:\webserver-source” \\client-web2\webserver-bin /mir /mon:1  /mot:1 /R:3 /W:10 /COPY:DAT /log:c:\tools\robolog.txt /NDL /NP /Z

/MIR = mirror mode, keeps trees in sync which means it will also delete files if source has deleted files.
/MON = monitors the source and runs again when more than # of changes are detected.
/MOT = monitors the source and runs again in X minutes if changes are detected.
/R = number of times to retry the current scheduled attempt, three strikes, let’s play baseball.
/W = number of seconds to wait in between each try.
/COPY = what flags to copy for files D-data A-attributes T-timestamps S-securityNTFSacls O-owner information u-auditing info.
/LOG = output log path and filename, overwrites existing log.
/NDL = no directory listing, don’t log the directory names, we know from our source where we are.
/NP = don’t display progress % of copied.
/Z = copy files in restartable mode.

Create and save this as a batch file!
It helps that you have your web-server source and destination the actual same path and folder names to keep things organized.  The first initial copy will always take the longest.

Set it as a scheduled task.  Have it run 23 hours a day, have the process kill when you are most comfortable checking this in the morning or evening and if all looks fine, re-run and repeat process.

For additional reading and understanding of Robocopy please visit Wikipedia link @
Microsoft Robocopy Technet Reference

Check out My Digital Life for an additional overview of Robocopy syntax and switches.


About noneil
Rapper turned Rockstar!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: