Thursday, November 18, 2010

Sync Web Servers with Web Deploy

"C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" -verb:sync -source:webserver,computername=server1 -dest:auto,computername=server2 -skip:objectName=dirPath,absolutePath=catalog\.wci > webdeploysync.log

Making use of the above command to sync the web server content and configuration in our farm (whilst ignoring the Indexing Service files which are locked)

Edit: Now using a batch file with the following contents triggered via a Scheduled Task every 5 minutes:

ECHO Starting at %DATE% %TIME% >> E:\WebDeploy\Sync.log
ECHO. >> E:\WebDeploy\Sync.log
ECHO Calling "msdeploy.exe -verb:sync -source:webserver,computername=server1 -dest:auto,computername=server2 -skip:objectName=dirPath,absolutePath=catalog\.wci" >> E:\WebDeploy\Sync.log ECHO. >> E:\WebDeploy\Sync.log
CALL "C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" -verb:sync -source:webserver,computername=server1 -dest:auto,computername=server2 -skip:objectName=dirPath,absolutePath=catalog\.wci -skip:objectName=filePath,absolutePath=\.log -skip:objectName=filePath,absolutePath=\.svclog >> E:\WebDeploy\Sync.log 2>&1
ECHO. >> E:\WebDeploy\Sync.log
ECHO Finishing at %DATE% %TIME% >> E:\WebDeploy\Sync.log

No comments: