[windows2000] Re: Sync specific directories from one server to multiple servers

  • From: "Ray at home" <listray@xxxxxxxxxx>
  • To: <windows2000@xxxxxxxxxxxxx>
  • Date: Fri, 3 Feb 2006 21:08:00 -0500

I'm a pretty big fan of robocopy, the command line copier that comes with
Windows XP Pro, I think, (can't remember if it comes with W2K) and is also
in the W2K Resource Kit, I believe.
 
Sample synchit.bat file:
 
@ECHO OFF
SET SOURCEDIR=%1
SET TARGETDIR=%2
SET LOGPATH=%3

IF {%SOURCEDIR%}=={/?} GOTO :Usage
IF {%SOURCEDIR%}=={} GOTO :Usage
 
IF {%LOGPATH%}=={} (SET LOGPATH=nul)
echo %date% %time%>>%LOGPATH%
robocopy %SOURCEDIR% %TARGETDIR% /NP /XA:S /R:2 /W:3 /MIR /LOG:%LOGPATH% /XD
"System Volume Information" "Recycler"
echo.>>%LOGPATH%
 
goto :eof
:usage
 
echo.
echo Usage:
echo.
echo synchit "C:\Source\Directory" "C:\Target\Directory" ["C:\Logpath.txt"]
echo.
 
Does that make sense at all?  You should check out the documentation on
Robocopy to see all the switches.  For example, the /MIR switch means that
not only will it copy all the files from %SOURCEDIR% to %TARGETDIR%, but it
will also delete files from %SOURCEDIR% if they don't exist in %TARGETDIR%,
because the idea here is to mirror the directories.
 
Ray at home
 
 


  _____  

From: windows2000-bounce@xxxxxxxxxxxxx
[mailto:windows2000-bounce@xxxxxxxxxxxxx] On Behalf Of James LaBorde
Sent: Friday, February 03, 2006 6:16 PM
To: windows2000@xxxxxxxxxxxxx
Subject: [windows2000] Sync specific directories from one server to multiple
servers


Hello,
 
We had an interesting event happen and are looking at being better prepared
for it the next time we have a similar problem arise.  As part of this
preparation, we would like to set up a way to sync two specific directories
from our production machine to several other machines.  Does anyone know of
an utility that could do this or perhaps some kind of batch script that
could be run to accomplish it?
 
Thank You,
James

Other related posts: