Daily IT Matters, this is the place where I post my daily findings on IT.

Wednesday, September 02, 2009

Netbackup Admin Script

Normal procedure for NetBackup with our Robot with 2 LTO4 tapes is physically adding media then do an inventory and then check in the gui your retention period for the tapes.
I've written a script which does all that. The only thing you need to change part where I let findstr search for eg LTO4 (all our LTO4 tapedrives use a pool with LTO4 in the name)

@echo off
cd "\Program Files\Veritas\Volmgr\bin"

Rem *****************
REM * Inventory Robot
REM *****************

vmupdate -rt TLD -rn 1 -h hpbck01 -rh hpbck01 -use_barcode_rules

Rem **************
Rem * Expire Media
REM **************

for /f "delims=, " %%a in ('"vmquery -rn 1 -bx findstr /I "LTO4""') do
"E:\Program Files\Veritas\NetBackup\bin\admincmd\bpexpdate.exe" -d 0 -ev %%a

Rem ****************************
Rem * Move media to scratch pool

for /f "delims=, " %%b in ('"vmquery -rn 1 -bx findstr /I "NetBackup""') do
vmchange -p 4 -m %%b