Get tape content via powershell

PowerShell script exchange

Get tape content via powershell

Veeam Logoby hgrams » Sat Jun 14, 2014 2:07 pm

Hi, is there a possibility to get the content of the stored data on tape? It is possible to get these information via Veeam shell. What I need is to get this information via script, e.g. to list all backed up files for all tapes of a media pool.
hgrams
Service Provider
 
Posts: 47
Liked: 5 times
Joined: Mon Jan 27, 2014 4:28 pm
Full Name: Harald Grams

Re: Get tape content via powershell

Veeam Logoby v.Eremin » Mon Jun 16, 2014 9:16 am

What type of tape job you're using? Backups to tape or files to tape one? Thanks.
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1026 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get tape content via powershell

Veeam Logoby hgrams » Mon Jun 16, 2014 9:56 am

I use "File copy to tape".
hgrams
Service Provider
 
Posts: 47
Liked: 5 times
Joined: Mon Jan 27, 2014 4:28 pm
Full Name: Harald Grams

Re: Get tape content via powershell

Veeam Logoby v.Eremin » Mon Jun 16, 2014 11:21 am

Below is what I was able to come up with. The script lists file name, along with its parent folder and current location (backup set name):

Code: Select all
Find-VBRTapeCatalog | select {$_.Parent.Path.Parent.Path}, name, {$_.Versions.location}


Thanks.
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1026 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get tape content via powershell

Veeam Logoby hgrams » Mon Jun 16, 2014 3:59 pm

Thanx for advice. Is it possible to get a relation to the used tape name. I use 30 to 40 different tapes, to looking for the right tape is very difficult. That would be great.
hgrams
Service Provider
 
Posts: 47
Liked: 5 times
Joined: Mon Jan 27, 2014 4:28 pm
Full Name: Harald Grams

Re: Get tape content via powershell

Veeam Logoby v.Eremin » Tue Jun 17, 2014 8:45 am

Can you ask why you need this sort of information? For restores? If so, wouldn't it be better to use the "Files" tree? There you can drill down to the required file or folder, right-click on it, go to "Restore Points" tab and see on what mediums the file resides. Thanks.
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1026 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get tape content via powershell

Veeam Logoby hgrams » Tue Jun 17, 2014 3:25 pm

It is more for reporting to show the customer which granularity of points in time it's possible to restore and which tapes are neccessary.
hgrams
Service Provider
 
Posts: 47
Liked: 5 times
Joined: Mon Jan 27, 2014 4:28 pm
Full Name: Harald Grams

Re: Get tape content via powershell

Veeam Logoby v.Eremin » Wed Jun 18, 2014 9:40 am

You can try to use something like the following and see whether it gives you what you're after:

Code: Select all
Foreach ($TapeCatalog in Find-VBRTapeCatalog)
{
$TapeCatalog.Parent.Path.Parent.Path, $TapeCatalog.name, (Get-VBRTapeMedium | where {$_.mediafamilyitem.id -eq $TapeCatalog.Versions.Parts.backupset.MediaFamilyId} | select barcode) 
}


I've tested it roughly, so, please, double check whether you get correct information (path, file, barcode, etc.).

Thanks.
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1026 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get tape content via powershell

Veeam Logoby hgrams » Wed Jun 18, 2014 3:10 pm

Thank you for the input. That is quite similar what I want. The rest is formatting.
hgrams
Service Provider
 
Posts: 47
Liked: 5 times
Joined: Mon Jan 27, 2014 4:28 pm
Full Name: Harald Grams

[MERGED] : Listing contents of Tapes.

Veeam Logoby darkhorse » Thu Jun 26, 2014 4:29 am

Afternoon,

Summary of requirement.
I have external group who would like to know What Tapes (in this case VTL's) have certain data on them.
So can I using Powershell maybe list the Tape written to with Date stamps. Like find-vbrtapecatalog but with the Tapes Labels as-well?

ie here it displays backed up source time but not the Tape each is on.

Name Path Created Date Size Restore Points
---- ---- ------------ ---- --------------
test.txt F:\ 1/05/2014 12:55:09 ... 175.9 GB 1
adc-emc1-irmf2014-03-06T150... D:\backup\adc-emc1-irmf 6/03/2014 3:00:33 p.m. 16.1 GB 1
adc-emc1-irmf2014-03-22T220... D:\backup\adc-emc1-irmf 22/03/2014 10:06:54... 16.2 GB 1


Cheers
darkhorse
Influencer
 
Posts: 13
Liked: 2 times
Joined: Wed May 21, 2014 10:07 pm
Full Name: Craig Ross

Re: Get tape content via powershell

Veeam Logoby v.Eremin » Thu Jun 26, 2014 8:36 am

Hi, Craig,

Kindly, try the script provided above and see whether it answers your requirements.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1026 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get tape content via powershell

Veeam Logoby CeeAr » Mon Dec 01, 2014 8:26 am

v.Eremin wrote:What type of tape job you're using? Backups to tape or files to tape one? Thanks.


Hi,

is there a way to get these file information for "backup to tape" jobs? I'm trying to find a way to get all tapes with latest full.

Thanks
Chris
CeeAr
Influencer
 
Posts: 19
Liked: 2 times
Joined: Tue Sep 17, 2013 1:09 pm

Re: Get tape content via powershell

Veeam Logoby v.Eremin » Mon Dec 01, 2014 9:09 am

Hi, Chris,

Do you have Veeam ONE deployed? Have you tried report called "Tape backup" in order to get that information?

Thanks.
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1026 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get tape content via powershell

Veeam Logoby CeeAr » Mon Dec 01, 2014 9:59 am

Hi,

no we don't. So there is no "powershell-way" ? Anyhow Veeam ONE looks promising.

Chris
CeeAr
Influencer
 
Posts: 19
Liked: 2 times
Joined: Tue Sep 17, 2013 1:09 pm

Re: Get tape content via powershell

Veeam Logoby v.Eremin » Mon Dec 01, 2014 10:40 am

The script provided above should work fine for both file to tape and backup to tape jobs. You can modify it a bit to make output look a bit better, though:

Code: Select all
foreach ($TapeCatalog in Find-VBRTapeCatalog)
{
$Info = ($TapeCatalog | select Name), ((Get-VBRTapeMedium | where {$_.mediafamilyitem.id -eq $TapeCatalog.Versions.Parts.backupset.MediaFamilyId}) | select barcode) 
$Info | Format-Table -Property Name, Barcode
}


Thanks.
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1026 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Next

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 1 guest