cancel
Showing results for 
Search instead for 
Did you mean: 

Expire Tapes Script

MariusD
Level 6

Hi all,

 

I need a script that expires more than one Tape at a time.

Any idea?

 

The CMD command to expire one tape is: 

C:\Program Files\Veritas\NetBackup\bin\admincmd\bpexpdate -m XXXXL4 -d 0

xxxx - letters and numbers.

 

 

Regards,

Marius D.

1 ACCEPTED SOLUTION

Accepted Solutions

MariusD
Level 6

@echo off
for /f %%t in (tapelist.txt) do call "C:\Program Files\VERITAS\NetBackup\bin\admincmd\bpexpdate.exe" -m %%t%1 -d 0 -force

 

but at the end when all tapes are expired, i want to receive a confirmation

ideas?

View solution in original post

10 REPLIES 10

Will_Restore
Level 6

works on one volume at a time.  You could create a for loop to handle multiple volumes:

for %v in (vol1 vol2 vol3) do C:\Program Files\Veritas\NetBackup\bin\admincmd\bpexpdate -m %v -d 0

MariusD
Level 6

i found this  https://www-secure.symantec.com/connect/forums/scr...

i like the J.Hinchcliffe. idea but i would like to have just a bat file and this tapelist.txt file.

How to write the expire.bat and expiremore.bat (from J.H. example)  just in one file?

MariusD
Level 6

.

J_H_Is_gone
Level 6

I could write the loop for unix and have in the past.

Just not that good with windows scripting to write the loop to read in a txt file

MariusD
Level 6

@echo off
for /f %%t in (tapelist.txt) do call "C:\Program Files\VERITAS\NetBackup\bin\admincmd\bpexpdate.exe" -m %%t%1 -d 0 -force

 

but at the end when all tapes are expired, i want to receive a confirmation

ideas?

Will_Restore
Level 6

for interactive operation

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

If I can come in at this point and ask WHY do you need to bulk-expire tapes?

Retention periods are there because of business requirements. Experience has taught us that a restore is requested shortly after manual premature expiration..............

Use the need to expire tapes as motivation to purchase more media.

mph999
Level 6
Employee Accredited

Adding to Mariannes excllent post ...

... she is correct, there shoud be no need to be regularly (not that you say for certain this is a regular procedure) manually expiring tapes, this is 'micro-managing' the media, which is what NBU is for.

If you really have a need for this, be very very careful - I had a case a while ago where the incorrect media was expired, 100's of tapes ...  

So, please please bear this in mind, Symantec do not recommend this, and, if you lose data, there is nothing we can do about it.

Martin

MariusD
Level 6

i need the script just to expire some copy backup tapes (not the primary copy) while i need to purchase more tapes.

 

other ideas with this script?

J_H_Is_gone
Level 6

add a second for loop tht does this command

"C:\Program Files\VERITAS\NetBackup\bin\admincmd\bpmedialist.exe" -m %1

if it comes back with any out other than it is not in the database than the tape did not expire.

If I had time I could do better but this is what I have off the top of my head.