
123-VCB Image Capture Script
123-VCB - Symantec Backup Exec alternative FREEFree and easy to use image capture script which runs along side the Vmware Consolidated Backup software package.
This script can be used with scheduled tasks to automate week / months of backups and maintain your file-structure whilst tidying up old backups.
This is a very simple to use script:
Code:
@echo off
echo ## ##### ##### ##### ##### ## ## ## ##### ##### ##### ## ## #####
echo ## ## ## ## ## ## ## ## ## # # ## ## ### ## ##
echo ## ##### ### # ##### ## ## ## ## ## # # ## ## ## ### #####
echo ## ## ## ## ## ## ## ## ## # # ## ## ## ## ##
echo ## ##### ##### ##### ##### ##### ##### # ##### ##### ## ## #####
echo Copyright www.123solutions.com
echo ..
echo Developed by:
echo Mike Wroughtron
echo Steven Church
REM =========================================================================
REM =========================================================================
REM This script takes an argument in the form of a virtual server's hostname,
REM it will then remove an old backup if it exists and take a new backup
REM ############CHANGE THE BELOW VARIABLES#############
SET USERNAME=YourDomainUSERNAME
SET PASSWORD=YourPASSWORD
SET VCBPATH=C:\Program Files (x86)\VMware\VMware Consolidated Backup Framework\vcbmounter
SET VSPHERESERVER=YourServer
REM ##############################################
REM ############CHANGE THE BELOW SETTING##############
REM Change this to the path of you stored images
cd N:\VMImages
N:
REM ##############################################
REM ############CHANGE THE BELOW SETTING##############
REM Change to your stored directory
SET DIRECTORYPATH=N:\VMImages
REM ##############################################
REM =========================================================================
REM =========================================================================
REM SET UP THE VARIABLES FOR THE "FOR LOOP"
REM ***************************************
REM : SET LOOPVAR to the ammount od weeks / days
SET /A LOOPVAR=%3 + 1
IF EXIST %DIRECTORYPATH%\%1-%2-%3 rmdir %DIRECTORYPATH%\%1-%2-%3
:BEGINING
REM : Check to see if loopvar is greater than 1
IF %LOOPVAR% lss 1 GOTO ENDLOOPVAR
IF %LOOPVAR% gtr 0 GOTO LOOPER
REM : Start loopvar
:LOOPER
SET /A LOOPVAR=%LOOPVAR% - 1
SET /A LOOPVARINC=%LOOPVAR% + 1
REN %DIRECTORYPATH%\%1-%2-%LOOPVAR% %1-%2-%LOOPVARINC%
goto BEGINING
:ENDLOOPVAR
"%VCBPATH%" -h %VSPHERESERVER% -m san -u %USERNAME% -p %PASSWORD% -a ipaddr:%1 -r "%DIRECTORYPATH%\%1-%2-1" -t fullvm
Instillation InstructionsPrerequisites:
- Vmware Consolidated Backup
1. Download the zip file attached to this thread
2. Unzip to
C:\Windows3. Set up a scheduled task to run the following example:
Execute Program : C:\windows\VCBImage.cmd
Parameters: yourserver WEEK 4The breakdown of this is as follows:
Parameter 1: Your Server Name
Parameter 2: A comment, we use WEEK or DAYS, depending how frequent you do VCB Backups
Parameter 3: How many time you want it backed up. If set to a weekly backup and this is
4 it will keep 4 weeks of backups.
Job done
