MSdeploy.exe is an important tool that you can use to sync web sites or ftp sites. I was testing msdeploy to keep two IIS7 FTP sites in sync. I used the following command:
msdeploy -verb:sync -source:apphostconfig="ftproot" -dest:apphostconfig="ftproot",computername=2ndserver
The sync works of course, but at the same time I found that one of my folders in d:\data was also syncing to the 2nd server. It had delete all other folders and files in the d:\data on the 2nd server!
The reason it seems is that the sync verb will sync everything including physical folders defined by your FTP virtual directory! The problem was that I had created an FTP virtual directory whose physical path is d:\data. This caused msdeploy to also sync any FTP vdir physical path to the 2nd server and with undesirable effects if you don’t want this to happen. If you only want to sync the FTP vdir but not the sync the contents of the physical folders, you need to get msdeploy to skip folders with the following:
msdeploy -verb:sync -source:apphostconfig="ftproot" -dest:apphostconfig="ftproot",computername=2ndserver -skip:objectName=dirpath,absolutePath=".*"