05-10-2012 06:15 AM
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.
Solved! Go to Solution.
05-10-2012 06:47 AM
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
05-10-2012 06:26 AM
the NetBackup command syntax is
bpexpdate -d 0 -force -m MediaID
05-10-2012 06:31 AM
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?
05-10-2012 06:40 AM
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.
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......
05-10-2012 06:47 AM
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
05-11-2012 04:58 AM
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.
05-11-2012 05:16 AM
Do I need to run the bpexpdate command from my Master server, or can it be run from a media server?
05-11-2012 06:03 AM
Its always good to run this command from master server & mention media server name if applicable.
05-11-2012 07:18 AM
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.
05-11-2012 07:44 AM
'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
05-11-2012 08:04 AM
I think i'm going to have to....thanks for everyone's help.
05-18-2012 07:39 AM
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
05-21-2012 11:56 PM
GREAT !
But my bad luck,
b'coz few years back i was not part of this forum & hence worked a lot to expire tapes