Video Screencast Help

Expire tapes in a volume pool

Created: 09 Dec 2012 • Updated: 17 Dec 2012 | 6 comments
This issue has been solved. See solution.

Hi There,

 

Is there a command(s) to expire all tapes in a specific volume pool? we are using Symantec Netbackup 7.1.

 

Edit: what i need is a script that automate this process,

the master and media servers are windows based.

 

 

Comments 6 CommentsJump to latest comment

Kiran Bandi's picture

Not sure if a single command can do what you require.

But a script with below two commands can do that. With script, you no need to provide media ids to bpexpdate manually.

vmquery -h <Serv Name> -pn <Pool Name> -a   : Lists all volumes in specified pool.

bpexpdate -m <media id> -d 0 : For expiring media (I think this command also de-assigns the media)

Nagalla's picture

hi,

i am not sure what is your requirement, but you need to make sure that you are doing correct, because expiring images is not revarsable, and so its better to go with the client name of specific date or induidial tape..

i believe you are sure about the whats you want.

below are the commands to get help you to expire ,  you can keep this in a file and run it as script,if not you can sue directly.. i assume you have unix master server.

 

 

/usr/openv/volmgr/bin/vmquery -pn <Poolname> -l | awk '{print$1}' >> /tmp/tape_list 
 
for i in `cat /tmp/tape_list` ; do /usr/openv/netbackup/bin/admincmd/bpexpdate -m $i -d 0 -force;done
 
hope this helps..
 
 
----
dont forget to "Thumbs up" or mark as Solution if any post helps.
 
u500302's picture

thank you Kiran and Nagalla,

we have windows based master and media servers.

recently, we have reduce the retention for the images, so we need to make sure that weekly tapes will not get full before completing the backup.

I need a script to expire the tapes in a specific pool, this will be run via windows task schedule once a week prior to weekly backup.

 

your help is really appreciated.

 

thanks and regards,

 

Marianne's picture

Never a good idea to manually expire tapes, and definitely not via an automated script.

This how 'accidents' happen and the wrong tapes with critical data are expired and overwritten.

If retention levels have changed, rather identify tapes and manually run bpexpdate with '-recalculate -ret <retention level>' so that NBU will recalculate new expiration date.

Use Tape Summary report (with Verbose option) to list all tapes with their expiration dates.

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links

u500302's picture

Thanks for your reply Marianne,

I am aware of the risk behind that, we remove the tapes and store them offsite every monday,

the inserted tapes are assigned to a specific pool.

 

as you said, we have changed the retention recently, now we are expiring 20 tapes manually every week.

monthly, yearly, and critical tapes are assigned to a different pool and stored offsite.

It will be great if we have a script to run every week once we insert the tapes to use instead of expiring the tapes manually.

 

all our tapes are kept in a tape rotation sheet that gurantee data availability based on company policy.

 

Mark_Solutions's picture

If you dont mind a little manual intervention then here is an easy way - but do be careful!!

Make a new directory on the Master Server for the files i am about to list (or on a Media Server / Admin Console PC - as this is for Windows)

In the volume pool view sort it (may have to add the colums to be visible) so that Media ID is first and Media Owner is next - this is so that you can see which media server owns the tapes (unless you use media sharing in which case i will need to edit the scripts)

So, in that directory make some files named tapes_mediaserver1.txt etc. so that you have as many text files as you have media servers and named appropriately

Next make another one named expire_tapes.bat and in it put the following:

for /f %%a in (tapes_mediaserver1.txt) do bpexpdate -m %%a -d 0 -host mediaserver1 -force

for /f %%a in (tapes_mediaserver2.txt) do bpexpdate -m %%a -d 0 -host mediaserver2 -force

pause

add as many of those lines as needed so that you have a line for each media server with its associated .txt file and named correctly after the -host part of the command.

If you do not have the netbackup\bin\admincmd in the path variables then it needs the full path using something like this:

... do "C:\program files\veritas\netbackup\bin\admincmd\bpexpdate" -m ....

(just to show you where the speech marks need to go)

So all you do now is sort the tapes in the volume pool view by media server, highlight the ones you want to expire and Ctl-C then paste into that media servers text file.

Repeat for each media server (should only take a minute or so to do this) and then run the .bat file

You just need to make sure that the Media ID is in the first column as that is what the script will read.

I have added the pause at the end so that it does not close, just in case there is a type or error.

Hope this helps - but please, please be careful!

Authorised Symantec Consultant

Don't forget to "Mark as Solution" if someones advice has solved your issue - and please bring back the Thumbs Up!!.

SOLUTION