PowerShell script exchange
hgrams
Service Provider
Posts: 78
Liked: 10 times
Joined: Jan 27, 2014 4:28 pm
Full Name: Harald Grams
Contact:

Get tape content via powershell

Post by hgrams »

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.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

What type of tape job you're using? Backups to tape or files to tape one? Thanks.
hgrams
Service Provider
Posts: 78
Liked: 10 times
Joined: Jan 27, 2014 4:28 pm
Full Name: Harald Grams
Contact:

Re: Get tape content via powershell

Post by hgrams »

I use "File copy to tape".
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

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.
hgrams
Service Provider
Posts: 78
Liked: 10 times
Joined: Jan 27, 2014 4:28 pm
Full Name: Harald Grams
Contact:

Re: Get tape content via powershell

Post by hgrams »

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.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

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.
hgrams
Service Provider
Posts: 78
Liked: 10 times
Joined: Jan 27, 2014 4:28 pm
Full Name: Harald Grams
Contact:

Re: Get tape content via powershell

Post by hgrams »

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.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin » 1 person likes this post

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.
hgrams
Service Provider
Posts: 78
Liked: 10 times
Joined: Jan 27, 2014 4:28 pm
Full Name: Harald Grams
Contact:

Re: Get tape content via powershell

Post by hgrams »

Thank you for the input. That is quite similar what I want. The rest is formatting.
darkhorse
Influencer
Posts: 13
Liked: 2 times
Joined: May 21, 2014 10:07 pm
Full Name: Craig Ross
Contact:

[MERGED] : Listing contents of Tapes.

Post by darkhorse »

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
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

Hi, Craig,

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

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

Re: Get tape content via powershell

Post by CeeAr »

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
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

Hi, Chris,

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

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

Re: Get tape content via powershell

Post by CeeAr »

Hi,

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

Chris
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

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.
ekisner
Expert
Posts: 203
Liked: 34 times
Joined: Jul 26, 2012 8:04 pm
Full Name: Erik Kisner
Contact:

[MERGED] : List of Tape restore points by media pool

Post by ekisner »

My goal is to extend an existing powershell function, which provides me with the most recent replica, incremental, and full backup point for each VM.

I would like to also know the most recent backup point for a VM stored on my assorted media pools (incremental, weekly, and monthly). The specific values I will end up obtaining will be the backup file name, the tape it is stored on, and when it got on that tape.

After parsing the results into HTML, I've got an at-a-glance view of all of my most recent restore points for each VM, showing me the viability of each method of recovery.

To that effect, I started searching. It looks as though Find-VBRTapeCatalog would be the place to start, however I see that is deprecated with no mention of a new command to use in its place. To make matters worse, it throws an error when I run that command:
No files found in the backup set <UUID> where <UUID> is a nice long alphanumeric

Not really seeking help yet for that error, I have a pretty good idea of what needs to happen there (find the backup set, and remove it if it's harmless - which it probably is).

I'm using a backup-to-tape job.

Does anyone have any suggestions where to start? I'd love for my function to be good past version 8.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

If you don't happen to have Veeam ONE deployed, take a look at the scripts provided above and see whether they meet your expectations. Thanks.
ekisner
Expert
Posts: 203
Liked: 34 times
Joined: Jul 26, 2012 8:04 pm
Full Name: Erik Kisner
Contact:

Re: Get tape content via powershell

Post by ekisner »

Thanks Vladimir, I did indeed see them. My question was moreso based on what command is replacing Find-VBRTapeCatalog?
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

Currently, there is no alternative to the said commandlet. It has deprecated label, because the tape PS model has been revised seriously in version 8 and some remnants of obsolete model have been marked as deprecated.

Thanks.
vash3g
Novice
Posts: 3
Liked: never
Joined: Jun 25, 2015 12:58 pm
Full Name: Stephen Colburn
Contact:

[MERGED] : Tape backup information script

Post by vash3g »

I am trying to find the correct commands for a post backup script for one of my tape jobs. I created this job for archiving old user profiles to tape so this is just a bunch of zip and pst files to archive. I would like to get a report after it is run to provide me with the tape ID and file contents from that. There is only one tape for that media pool at any time. The file contents would be a huge boon for this.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

Check the script provided above and see whether it meets your expectations. Thanks.
vash3g
Novice
Posts: 3
Liked: never
Joined: Jun 25, 2015 12:58 pm
Full Name: Stephen Colburn
Contact:

Re: Get tape content via powershell

Post by vash3g »

Apparently I have a backup set with no files in it and its throwing an error. How can I check to see what that job has an error with?
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

Not sure whether I got your question, are you saying that you get an error when running the provided script against your backup server? What particular error you get?
vash3g
Novice
Posts: 3
Liked: never
Joined: Jun 25, 2015 12:58 pm
Full Name: Stephen Colburn
Contact:

Re: Get tape content via powershell

Post by vash3g »

Find-VBRTapeCatalog : No files found in the backup set a298209f-760a-4fd4-b6ff-07cc5c153988
At line:1 char:26
+ foreach ($TapeCatalog in Find-VBRTapeCatalog)
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Find-VBRTapeCatalog], Exception
+ FullyQualifiedErrorId : System.Exception,Veeam.Backup.PowerShell.Command.FindVBRTapeCatalog
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

You can find job with failed session, using the following commandlet:

Code: Select all

foreach ($Job in Get-VBRTapeJob)
{
if ((Get-VBRSession -Job $Job -Result Failed) -ne $Null){$Job.name}
}
However, what happens if you make the mentioned code silently continue if case it comes across an error by adding the corresponding parameter:

Code: Select all

Find-VBRTapeCatalog -ErrorAction SilentlyContinue
Thanks.
LeoKurz
Veeam ProPartner
Posts: 28
Liked: 7 times
Joined: Mar 16, 2011 8:36 am
Full Name: Leonhard Kurz
Contact:

[MERGED] : Find Restore points on tape

Post by LeoKurz »

Hello,

I'm trying to find the restore point of a certain VM that can be found on tape. Any idea? VErsion 8 with Update 2

__Leo
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

Hi, Leo,

Your post has been merged into existing discussion talking about similar matter.

By the way, don't you have a Veeam ONE deployed? If so, kindly, see the Tape Report which should answer your requirements.

Thanks.
ccatlett1984
Enthusiast
Posts: 83
Liked: 9 times
Joined: Oct 31, 2013 5:11 pm
Full Name: Chris Catlett
Contact:

[MERGED] : How to get list of files in "files to tape" sessi

Post by ccatlett1984 »

This relates to my other thread:
http://forums.veeam.com/powershell-f26/ ... 31312.html

I haven't been able to find a cmdlet to pull the list of files that were backed up in a tape session.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get tape content via powershell

Post by veremin »

Check the answers provided above and see whether the script answers your requirements.
aagrapart
Service Provider
Posts: 6
Liked: 1 time
Joined: Jan 30, 2015 3:19 pm
Contact:

Re: Get tape content via powershell

Post by aagrapart » 1 person likes this post

Hello,

Is there a Find-VBRTapeCatalog cmdlet substitution in the V9 version or is it planned in the v9.5 ?

If it's not planned, is it possible to access to the tape catalog to export it's content list ?

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests