Backing up you VMs with VCB and RoboCopy
4/13/2010
Here's a script I use to backup my VMs and then RoboCopy the the files to my DR site.
This command gets the day of the week (IE. Monday, Tuesday, etc..)
@for /F "tokens=1,2 delims=/ " %%A in ('date /t') do @( Set Day=%%A)
Set this variable to the server name you're backing up. This must match the name that is in vCenter Or vsphere
set ServerName=MyServerName
Set this to your VCenter or Vsphere server name
set vCenterServerName = MyVcenterServer
This command creates a snapshot then copies the data to b:\TheServersName\DayOfTheWeek
"C:\Program Files (x86)\VMware\VMware Consolidated Backup Framework\vcbMounter.exe" -h %vCenterServerName% -u vmwareBK -p password123 -a name:%ServerName% -r b:\%ServerName%\%Day% -t fullvm -m nbd
This command copies the VCB backup to our DR site
"C:\Program Files (x86)\Windows Resource Kits\Tools\robocopy.exe" "b:\%ServerName%\%Day%" "\\DrServer1\Backups\VMs\%ServerName%\%Day%" /NP /S /E /R:2 /W:2 /MIR /PURGE /log:"\\DrServer1\Backups\VMs\Logs\%Day%-%ServerName%.log"
Aaron Software takes no responsibility for the implementation of this shared code.