cancel
Showing results for 
Search instead for 
Did you mean: 

Expiring Media Script

Dan_Giberson
Level 5

I'm looking for a Windows script (powershell would be nice) to expire approximately 1000 tapes. We have had to place a hold on a large amount of media for the past year due to a legal matter and would now like to release the media. My experience in the past is that just changing the date in the GUI doesn't really do much. These tapes are all currently set with an Infinite retention, and I would now like to expire the tapes that should have expired naturally through the normal retention period.

Anyone have any good suggestions? Currently running NBU 7.01 on W2K3.

1 ACCEPTED SOLUTION

Accepted Solutions

mph999
Level 6
Employee Accredited

Hmm, if you were to log a support call with Symantec, and ask very very nicely ... there may be  a way to do this quicker using manual SQL commands ...

Martin

View solution in original post

12 REPLIES 12

Will_Restore
Level 6

the NetBackup command syntax is

bpexpdate -d 0 -force -m MediaID

 

Dan_Giberson
Level 5

Or, could I do a bpexpdate -recalculate to change the retention on the older backups to auto expire? THis is only for four clients so I don't think it will be too difficult, just need to figure out the correct context. And how to change the retention based on each schedule (daily / weekly / monthly). As this is an Exchange backup, I can't just differentiate between Full and Incremental as they are all Full.

 

Something like:

bpexpdate -recalculate -policy POLICYNAME - ret 4

 

Or am I just going to have to do this manually?

Yogesh9881
Level 6
Accredited

Ohh 1000 tapes .... !!

what is your catalog size ?

b'coz few years back i come across same situation & it took 6 to 7 min for each tape.angry

that time my catalog size was 350 GB

i managed it by doing loop method in solaris box & took almost 4 months (off hours)  

GOOD LUCK......

mph999
Level 6
Employee Accredited

Hmm, if you were to log a support call with Symantec, and ask very very nicely ... there may be  a way to do this quicker using manual SQL commands ...

Martin

Mark_Solutions
Level 6
Partner Accredited Certified

Not an easy one this - have been thinking about it and maybe the answer just needs a little planning.

One thing I did want to say is that changing the date in the GUI changed the expiry date of the volume (when it will never be used again by NetBackup, not the date of the images on it - so dont do that!)

Get your list of tape involved viweable in the GUI and make sure you have shown the Last Written and Media Owner in the columns.

Highlight them all and CTL-C then paste into excel

Sort by media owner and split them onto tabs for each media server.

Sort these by last written so that you can group them together into sets of dates and work out when you actually want them to expire.

Then just use bpexpdate -m ABC123 -d 05/23/2012 23:59:59 -host mediaservername

(This date and time just being an example)

If you put each set of tapes for each media server into a text file, named server1.txt, server2.txt etc then you could run a script such as:

for /f %%a in (server1.txt) do bpexpdate -m %%a -d 05/23/2012 23:59:59 -host server1 -force

Do this for each date set, changing the date for each set.

Once they are all done run:

bpimage -cleanup -allclients

To do an image cleanup followed by:

bpexpdate -deassignempty -force

To clean down all of your tapes.

Dont know if this will help - guess it depends how many different date sets you have involved.

If you are using media sharing groups you probably wont need the -host bit so could put all tapes for one date into a single file.

Dan_Giberson
Level 5

Do I need to run the bpexpdate command from my Master server, or can it be run from a media server?

Yogesh9881
Level 6
Accredited

Its always good to run this command from master server & mention media server name if applicable.

Dan_Giberson
Level 5

I'm going to need to find a better way....with over 1000 tapes this is pinning my server. It's also average 2-3 hours per tape to delete.

Marianne
Level 6
Partner    VIP    Accredited Certified

'2-3 hours per tape to delete' ??  OUCH!!!!

Please log a support call as per Martin's advice... https://www-secure.symantec.com/connect/forums/expiring-media-script#comment-7110001

 

Dan_Giberson
Level 5

I think i'm going to have to....thanks for everyone's help.

Dan_Giberson
Level 5

Just an update for everyone....I called into Symantec and the only option I was given was to query the catalog for set date ranges / policies / etc... and manually expire them. After that I ran

bpexpdate -deassignempty -force

which cleared out the empty tapes. Thanks for everyone's help.


Dan

Yogesh9881
Level 6
Accredited

GREAT !

But my bad luck, 

b'coz few years back i was not part of this forum & hence worked a lot to expire tapes cryingfrown