cancel
Showing results for 
Search instead for 
Did you mean: 

Extending media Id with volume pool name

ram619
Level 5
Certified

Hi,

I have to extend the retention level of 90 media's from 1 year to infinity. All the media's are resides in same volume pool. Instead of extending the retention level  with media id is there any way to extend with volumepool name.

6 REPLIES 6

Will_Restore
Level 6

works with media_id or backup_id but not volume_pool

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

Hi,

 

No you can't but you can do this. Off the top of my head (don't have a system open, and assuming this is unix)

 

bpmedialist -mlist -l -p POOLNAME  | awk '{ print $1 }'

 

that should give you just the media ID's but please verify before running the full command below

 

bpmedialist -mlist -l -p POOLNAME  | awk '{ print $1 }' | while read id

do

bpexpdate -m $id -d YOUR NEW DATE -force

done

CY
Level 6
Certified

The media's retention (data expiration date) was determined when the backup image was successfully created on the media, so it does not matter if the tapes were in the same volume pool or in different volume pools. Since you have 90 tapes that need to be changed, you can write a script to do the job for you.

Here is my simple script to extend the tapes' expiration date (Unix/Linux environment):

 

#!/bin/ksh
for Media_ID in `cat /tmp/tape_to_extend`
do
        /usr/openv/netbackup/bin/admincmd/bpexpdate -m $Media_ID -d infinity -force
done

 

You just need to save all your 90 tapes' ID in the /tmp/tape_to_extend file (ASCII file) and run the script.  Verify the result with bpmedialist -m 'Media_ID" and see if the expiration date has been changed.

ram619
Level 5
Certified

Sorry to not specify the OS platform. Am into Windows platform.

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

Hmmm,

 

Try this

 

for /F "usebackq tokens=1" %i (`bpmedialist -mlist -p <YOURPOOL> -l`) do @echo bpexpdate -m %i -d (YOURNEWDATE> -force >> C:\extendexpiration.bat

J_H_Is_gone
Level 6

use at your own risk - and test to make sure you got all the commands correct

 

make file tapelist.txt  - file contains 1 media id per line

A00001

A00002

A00003

 

---------------------------

make bat file change.bat in same directory as above (this file was written to be used for 1 tape at a time)

Normal input: expire.bat  A00001

would first show you the tape to verify that you really want to change all images on the tape

then change the tape

then would look the tape up again - when it shows it to you again you can check that it did it correctly

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

---------------------------------------------

make new bat file  changemany.bat

echo off
for /f %%t in (tapelist.txt) do change.bat %%t
echo on 

-------------------------------------

if you do not want it to ask for each tape then just use the middle line in the change.bat and it will go through and do them all - you will have to check after to verify that it did change them all.  And you end up with something that is reuseable for 1 tape at a time  or for many tapes.