Chad_Wansing
18 years agoLevel 4
Bulk Expiration of Tapes
Hello all. While working through some compliance stuff last week I came across a period of time where our organization was obviously keeping everything with an indefinite retention and was tasked by my manager with ensuring anything we have complied with our current retention schedule..........so I wound up with the dubious privledge of having to manually expire approximately 300 tapes across a couple different master servers. Below is the text of a vbscript I wrote that I hope some of you other NBU on Windows admins may be able to make use of. I sort the total media for whatever site I'm working within by its "Time Assigned" field, Ctrl-C that info into an Excel spreadsheet and then just copy the column containing the media ID's into a .txt file I called "OldTapeList.txt". Then I run my script file which reads from the tape list, performs bpexpdate -d 0 -m -force (to supress the y/n prompt) in parallel for every tape listed. You'll have to change the script for your specific location of where you locate your tape list.
This was actually my first ever VBscript, and I hope you all can get some use out of it. I learned a ton writing it. I actually hope to have its powershell conversion done sometime next week (when I get some time).
Please feel free to contact me via cwansing@ikon.com (e-mail or IM) with any suggestions or concerns. Use it at your own risk, but it has worked fine for me for over 200 tapes now.
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set SOURCE = objFSO.OpenTextFile("E:\Program Files\VERITAS\NetBackup\bin\admincmd\OldTapeList.txt", ForReading)
Dim EXPIRE
EXPIRE = "bpexpdate -d 0 -m"
Do Until SOURCE.AtEndOfStream
TAPE = SOURCE.ReadLine
WshShell.Run""+EXPIRE+" "+TAPE+" -force"
Loop
SOURCE.Close
This was actually my first ever VBscript, and I hope you all can get some use out of it. I learned a ton writing it. I actually hope to have its powershell conversion done sometime next week (when I get some time).
Please feel free to contact me via cwansing@ikon.com (e-mail or IM) with any suggestions or concerns. Use it at your own risk, but it has worked fine for me for over 200 tapes now.
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set SOURCE = objFSO.OpenTextFile("E:\Program Files\VERITAS\NetBackup\bin\admincmd\OldTapeList.txt", ForReading)
Dim EXPIRE
EXPIRE = "bpexpdate -d 0 -m"
Do Until SOURCE.AtEndOfStream
TAPE = SOURCE.ReadLine
WshShell.Run""+EXPIRE+" "+TAPE+" -force"
Loop
SOURCE.Close