cancel
Showing results for 
Search instead for 
Did you mean: 

A Script to Create Volume Pools, add Tapes, add Policy, add Schedules

MariusD
Level 6

Hi all,

 

I want to make a script:

 

create 20 volume pools: "INCR01 - INCR20". In "INCR01" comes  tape "TAPE01" ..."INCR20" comes tape "TAPE20"

 

create 14 volume pools: "FULL01 - FULL14". In "FULL01" comes tape "TAPE21"... in "FULL14" comes tape "TAPE34"

 

create 2 volume pools: "FULLM01-FULM02". In "FULLM1" comes tape"TAPE35" and in  "FULLM2" comes tape "TAPE36"

 

create 1 volume pool: "FULLQ1". In "FULLQ1" comes tape "TAPE37"

 

 

And after all pools are created come 1 Policy with 37 Schedules. 1 Schedule for each tape.

 

20 Tape for 20 Daily incremental  backup (Monday-Friday)  .....{for 4 Weeks are 20 work days}

14 Tape for 14 Weekly full backup just Saturday              ..... {for 3 Month are 12, 13 or 14 weeks}

2 Tape for 2 Monthly full backup just in last Saturday of Month  {each Month 1 Tape go OUT(safe place)}

1 Tape for 1 Quarterly full backup just in last Saturday of March, June, September and  December.  {all at 3 months/quarterly 1 tape go OUT(safe place)}

 

Can I create SCRIPT for all of this????????

1 ACCEPTED SOLUTION

Accepted Solutions

Karthikeyan_Sun
Level 6

Just do the Following:

 

Go to :

 

1. Install Path\Volmgr\bin in command prompt

 

2. type the location of the Script file in your case "c:\scripts\script_backup.vbs" and Press Enter

 

Let me Know the OutPut !

 

View solution in original post

7 REPLIES 7

MariusD
Level 6
"Can I create SCRIPT for all of this??" :))) yes i can but HOW????????????

knows someone to do such a script?????? ? or just help me to design so a script.

 

Karthikeyan_Sun
Level 6

Batch File: https://forums.symantec.com/syment/board/message?board.id=21&message.id=50242

 

VB Script: https://forums.symantec.com/syment/board/message?board.id=21&message.id=50250

 

This will help you  to create volme pools and add tapes to volume pool.

 

Repeat the above Scripts for Policy Creation and Schedule Creation by using following commands:

 

Create Polciy :

 

install_path\NetBackup\bin\admincmd\bppolicynew policy_name [-verbose] [-M master_server,...] install_path\NetBackup\bin\admincmd\bppolicynew policy_name -sameas existing_policy_name [-verbose] [-M master_server,...] install_path\NetBackup\bin\admincmd\bppolicynew existing_policy_name -renameto policy_name [-verbose] [-M master_server,...]

 

Create Schedule:

 

install_path\NetBackup\bin\admincmd\bpplsched policy_name [-v] [-M master_server...] [-L | -l | -U] [-label sched_label]  install_path\NetBackup\bin\admincmd\bpplsched policy_name [-v] [-M master_server...] -delete sched_label ... install_path\NetBackup\bin\admincmd\bpplsched policy_name [-v] [-M master_server...] -deleteall install_path\NetBackup\bin\admincmd\bpplsched policy_name [-v] [-M master_server...] -add sched_label [-st sched_type] [-freq frequency] [-mpxmax mpx_factor] [-number_copies number] [-synthetic 0|1] [-pfi_fast_recovery 0|1] [-rl retention_level [,rl_copy2,...,rl_copyn]] [-residence storage_unit_label [,stunit_copy2,...stunit_copyn]] [-pool volume_pool_label [,pool_copy2,...pool_copyn] [-res_is_stl 0|1] [-fail_on_error 0|1[,0|1,...,0|1]] [-sg share_group [,share_copy2,...share_copyn] [-window start_duration] [-cal 0|1|2] [-ut] [-incl mm/dd/yyyy] [-excl

mm/dd/yyyy] [-weekday day_name_week] [-dayomonth value | l]

 

 

Let me Know If you have more clarifications !

MariusD
Level 6

 I have tried with this script but doesn´t work. error: "Expexted end of statements 800A0401"

 

"

Dim IDCount,tpvmno

tpvmno=0

For IDCount= 0 to 20

strcommandvm="vmpool -create -pn INCR" & IDCount & " -description INCR" & IDCount tpvmno=IDCount+4 strcommandtp="vmadd -m TAPE" & IDCount & " -mt HCART2 -p " & tpvmno

Set objShell = CreateObject("WScript.Shell")

Set objExec = objShell.Exec("SETX HOMEPATH C:\Program Files\Veritas\Volmgr\bin")

Set objExec = objShell.Exec(strcommandvm)

Set objExec = objShell.Exec(strcommandtp)

Next

Wscript.Echo "Task Completed. Thanks for using the script!!!!"

"

 

What missing?? 

 

Thaks for reply.

Marius D.

Karthikeyan_Sun
Level 6

Dim IDCount,tpvmno

tpvmno=0

Set objShell = CreateObject("WScript.Shell")

For IDCount= 0 to 20

strcommandvm="vmpool -create -pn INCR" & IDCount & " -description INCR" & IDCount

tpvmno=IDCount+4

strcommandtp="vmadd -m TAPE" & IDCount & " -mt HCART2 -p " & tpvmno

Set objExec = objShell.Exec("SETX HOMEPATH C:\Program Files\Veritas\Volmgr\bin")

Set objExec = objShell.Exec(strcommandvm)

Set objExec = objShell.Exec(strcommandtp)

Next

Wscript.Echo "Task Completed. Thanks for using the script!!!!"

Run the above Script in Command prompt, Dont Run this file in GUI.

 

Let me know the Output !!!

MariusD
Level 6

Hi Karthikeyan,

 

the Output: 

 

"

C:\>cscript c:\scripts\script_backup.vbs

Microsoft (R) Windows Script Host Version 5.6

Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

 

c:\scripts\script_backup.vbs(17, 1) WshShell.Exec: The system cannot find the file specified.

"

 

what file can´t the system not find???

 

Thaks,

Marius D.

Karthikeyan_Sun
Level 6

Just do the Following:

 

Go to :

 

1. Install Path\Volmgr\bin in command prompt

 

2. type the location of the Script file in your case "c:\scripts\script_backup.vbs" and Press Enter

 

Let me Know the OutPut !

 

MariusD
Level 6

Thank you Karthikeyan for your help. Now work. Iuhuuuu :D. My first experience withscripts :))).

 

with respect,

Marius D.