12-09-2013 10:27 AM
Hi Folks,
Anyone please help me to get a script which trigger Mail with Details of Full Medias with Only Yearly Retention date. We don't want to eject those medias as I checked few scripts in this forum which eject those which are full. In our environment we will do the ejection manually but we want mail with details mentioning which medias are full and its expiration date is after one year only.Moreover, We created one vault profile but its ejecting only one media and waiting for MAP to be cleared before ejecting next one. If anyone help me in this where all media will be ejected at once. I am not sure about access port as it may allow to eject only one media which I still have to confirm from onsite support.
Master server : Windows 2008 R2
Netbackup Version : 7.1
Library :One T50e spectra logic – 2 LTO5 Drives
Thanks in Advance,
Nitesh Kumar
12-09-2013 07:36 PM
Hi Niteshry,
Try to review below link. It might help you in creating script using BLAT and nbmail.cmd
http://www.symantec.com/business/support/index?page=content&id=TECH24110
12-10-2013 04:34 AM
Thanks Adonis for the Link but, actually I need script which will trigger a mail mentioning full tapes with 1 year retention details only.
12-24-2013 04:57 AM
Scripting's not my strong point but you could wrap the following around the nbmail.cmd as that will get your output to your email.
First you would need to find out the retention level defined in your Netbackup environment.
Via commands this would be
../netbackup/bin/admincmd/bpretlevel
Or in the GUI under Master Server properties > Retention Periods
use that value (the default value for 1 year retention level = 8)
The following command will mention the tapes (1st column)
bpmedialist -l -rl 8
The output from this is will give you all tapes in the 1 year retention level (column 1) then you need to filter this output by the 15th column and those with a value 8 which defines status FULL media
Media status is all discussed here: bpmedialist
Or rely on the available_media.cmd script on your server to be sent. Or similarly email the Media Summary report output of 'bpmedialist -summary [-U|-L]'
12-24-2013 05:16 AM
Pop this in a file named oneyear.bat somewhere on your master server and have windows scheduler run it when you want it to (edit the install path if you need to) and relace 8 after the -rl with the level you use for a 1 year retention - assume blat is installed and configured on yoru Master Server:
"c:\program files\veritas\netbackup\bin\admincmd\bpmedialist" -rl 8 -U >c:\1year.txt
blat c:\1year.txt -s "1 year retnetion tapes" -t you@yourdomain.com
Hope this helps - merry Xmas
#edit#
noticed you wanted "Full" media - have to work a bit more on that one!!
12-24-2013 05:37 AM
AH! What the heck - its Christmas - try this....
On the master make a directory c:\tapes\
In there make two files named oneyear.bat and oneyear.vbs
Right click and edit oneyear.bat and paste in (editing the path and -rl number to suit):
"c:\program files\veritas\netbackup\bin\admincmd\bpmedialist" -rl 8 -l >c:\tapes\1year.txt
c:\tapes\oneyear.vbs
blat c:\tapes\fulltapes.txt -s "1 year retnetion tapes" -t you@yourdomain.com
Save than and then right click and edit the oneyear.vbs and paste in the following - nothing to edit in this one:
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\tapes\1year.txt", ForReading)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
arrFields = Split(strLine, " ")
If InStr(arrFields(14), "8") Then
strContents = strContents & arrFields(0) & vbCrlf
End If
Loop
objFile.Close
strContentsa = "Media ID" & vbCrlf
Set objFile = objFSO.CreateTextFile("C:\tapes\fulltapes.txt")
objFile.Write strContentsa
objFile.Write strContents
objFile.Close
Have windows scheduler run the oneyear.bat file for you - nice neat result
Hope this helps
12-30-2013 06:35 AM
Thanks a lot Mark/Stuart..I still have to try these Script. You know it's Holiday Time.
12-30-2013 06:44 AM
Holiday - what is one of those - LOL!
Have a good break and New Year - to give you an idea my last script pipes out something like this:
Media ID
AN0003
DA0004
DA0005
Thought that was nice and simple and the sort of thing you were looking for.
02-06-2014 11:28 AM
Did you ever try these?