Selecting and Moving Tapes in a Media Set

The nightly backups at work crossed the LTO5 capacity and moved onto a 2nd tape recently, and with the annual disaster recovery test looming over my head, I didn’t want to have to restore 2 tapes to get the critical systems up and running.

What I needed to do was modify the 2 backup jobs that I have running to shuffle what server backs up to what tape. Ok, so what’s the easiest way to do that? Create a 2nd media set, easy right? Of course. Now I need to move the tapes into 1 of the 2 media sets I now have. Ok, ok, that’s pretty easy too. I’m trying to make things sound interesting here!

So if you know anything about me you know I am going to do what I need to do with Backup Exec PowerShell module BEMCLI.

Firstly, I am going to create the new media set (See Modifying media sets in Backup Exec 2012 with PowerShell for my reasoning for setting these overwrite and append times):

New-BEMediaSet -Name "Keep Data for 4 Weeks – Daily Tape 1" -OverwriteProtectionPeriodHours 648 -AppendPeriodHours 12

Next I have to select the tapes that that I want to move to the new media set. The tapes at work are named “MON101″, “TUE101”, etc for the first tapes in the daily backups and “MON102”, “TUE102”, etc for the 2nd tape in the daily backups, so the “01” and “02” are what I want to select. To select all first tapes in the daily I would use this command:

Get-BEMedia -MediaSet "Keep Data for 4 Weeks" | Where-Object {$_.Name -like "*01*"}

Then move the selected tapes into the media set by using the move command.

Move-BEMediaToMediaSet -MediaSet "Keep Data for 4 Weeks – Daily Tape 1"

Unless you use a variable on the Get-BEMedia command, you will need to pipe the 2 commands for it to work like this:

Get-BEMedia -MediaSet "Keep Data for 4 Weeks" | Where-Object {$_.Name -like "*01*"} | Move-BEMediaToMediaSet -MediaSet "Keep Data for 4 Weeks – Daily Tape 1"

Finally, you can rename the original media set.


Rename-BeMediaSet -InputObject "Keep Data for 4 Weeks" -NewName "Keep Data for 4 Weeks – Daily Tape 2"

And there you have it. Comments and questions are always welcome.

@PCVirus_AU
Titan Solutions

Advertisements

About Phill McSherry
Phill McSherry has been working in the Australian IT industry for over 20 years and is the technical manager and solutions architect for managed services provider Titan Solutions - www.titansolutions.com.au

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: