VMware Cloud Community
VMNG
Contributor
Contributor

Anyone can help me to create a "VCB backup+ Veritas Backup EXEC 12" Scripts?

Hi all

I create following scripts bymyself, it works fine. However, I can not get anyerror message logs file and I need to run them separately. anyone familiar with those script, can you please edit my script.

I want to get error message report and if possiable, I want to run one script only (automount - backup -autodismount). Thanks all in advance.

Current VCB Backup Plan:

9:00PM-run Mount script to mount all vm to d:\mnt\. on file-level and image-level.

9:30PM-run Veritas Backup EXEC V.12 to backup all folders and files under d:\mnt\.

5:30AM(on next day)-run DisMount script to clear the d:\mnt\.

The mount and dismount script details shows below:

Mount Script

@echo off

echo start

c:

Cd "\Program Files\VMware\VMware Consolidated Backup Framework"

vcbmounter -h esx2.server.com -u root -p C0ugar -a name:app1aa d:\mnt\app1aa -t file -m san

vcbmounter -h esx2.server.com -u root -p C0ugar -a name:app1aa d:\mnt\app2aa -t fullvm -m san

echo end

DisMount Script

@echo off

echo start

c:

Cd "\Program Files\VMware\VMware Consolidated Backup Framework"

vcbmounter -h esx2.server.com -u root -p C0ugar -U d:\mnt\app1aa

d:

cd "mnt"

del app2aa/f/q

rd app2aa

echo end

Thanks all

Alex

Reply
0 Kudos
4 Replies
dave01
Enthusiast
Enthusiast

Just run the vcbmounter command directly in the pre-script and post-script

If you have command path such as "command not found" issues just set a windows path to the VCB program files folder, that way you can run the script without requiring the path.

If you put in a log level number such as -L 6 into the command this will show full details of the command, you will be able to see this in the job log, if this doesnt work you could allways pipe the output into a log file on the server.

Once you have done that you can tell the backup exec to label any non zero returns from the vcbmounter command as an error which you will see in the backup exec management interface

remember that you mount script will fail as thats trying to do a file and a full VM backup at the same time

Reply
0 Kudos
Schorschi
Expert
Expert

Also, add -L 6 to the vcbMounter command line. This will give you verbose details.

Reply
0 Kudos
thomaskn
Contributor
Contributor

Nice idea, but Veritas 12 has troubles in recognizing the %vcbbase% Variable. Veritas regards %vcbbase% as "C:\Programme\Symantec\Backup Exec\" so the scripts won´t be executed!

You can check that using a script:

-


echo start >> c:\vcb_veritas_failure.log

%vcbbase%\backupexec\pre-backup.bat

-


after checking the vcb_veritas_failure.log you can read:

Eingabefehler: Die Skriptdatei "C:\Programme\Symantec\Backup Exec\pre-command.wsf" wurde nicht gefunden.

Workaround is to use the Windows Scripting Host especially the pre-command.wsf and the post-command.wsf

Write your own pre-own.bat

echo start >> c:\vcb_log.txt

cd C:\PROGRA1\VMware\VMWARE1\generic

cscript pre-command.wsf C:\PROGRA1\VMware\VMWARE1 %1 fullvm >> c:\vcb_log.txt

and put the call "c:\Programme\VMware\VMware Consolidated Backup Framework\generic\pre-own.bat" myvm_to_backup

to work bevore the backup job

and the post-own.bat

echo -


löschen der VM %1 vom Backupproxy Zwischenverzeichnis -
>> c:\vcb_veritas_failure.log

rmdir /S /Q d:\mnt\%1-fullVM

after the backup job

so it functions correctly - tested.

Reply
0 Kudos
dave01
Enthusiast
Enthusiast

Thats why you should put it in as a perminant environment varyable in windows

in the path configuration put in the path to C:\Program Files\VMware\VMware Consolidated Backup Framework

This setting is found in mycomputer properires>advanced>environment variables, system varyables. Edit the path section and add ; C:\Program Files\VMware\VMware Consolidated Backup Framework

This way if you run the vcbmounter command from the RUN box or from a cmd window it will runn reguardless of what folder you are in at the time.

Then your pre-command becomes

vcbmounter -h virtualcenterhostname -u domain\user -p password -a ipaddr:vmhostname -r e:\mnt\vmhostname -t file

then you have a post command

vcbmounter -h vmhostname -u domain\user -p password -U e:\mnt\vmhosname

That should be all you need for file level backups, just run the first command before making your selections in backup exec, then after making the selections list and saving it, run the second command to clean up

I have this working with the latest version of VCB, esx3.5 update 1

Reply
0 Kudos