Get Repositories by Tape Jobs

PowerShell script exchange

Get Repositories by Tape Jobs

Veeam Logoby Avshalom » Tue Apr 22, 2014 8:18 am

Hello Guys,

I need your help, Please

I have two Tape Backup Jobs "Backup to Tape Job 1", "Backup to Tape Job 2"
Each has different Backup Repositories on it, From the GUI i can see all the reposoitories on any of the jobs but i can't export it to file and check if i'm backing up all the repositories i have, and see if i seperate them well between the two backup jobs.

so my question is, how can i get by powershell cmdlet the list of the repositories on the tape jobs.
i tried to run:
Get-VBRTapeJob | Get-VBRBackupRepository

but it's not working, can you please help me with this, how to get the information??
thanks a lot
Avshalom
Influencer
 
Posts: 18
Liked: never
Joined: Sun Mar 30, 2014 8:00 am
Full Name: Avshalom

Re: Get Repositories by Tape Jobs

Veeam Logoby tdewin » Tue Apr 22, 2014 9:41 pm

Couldn't find it in the tape commands. As a tape job is inheriting from a regular job, most of the repository stuff is related to target repository which doesn't make sense for tape jobs in specific

I did retrieve it directly in the database I think. Not giving any guarantees cause the db is a mystery to me as well and of course it is not guaranteed that this will work in newer or older versions. Maybe for a one time query it could be useful . Also notice that my queries could be optimized by using joins ;)

Repositories related to jobs
Code: Select all
SELECT
 (SELECT [name]
   FROM [VeeamBackup].[dbo].[Tape.jobs] WHERE [VeeamBackup].[dbo].[Tape.jobs].[id] = [job_id]) as JobName,
 (SELECT [name]
   FROM [VeeamBackup].[dbo].[BackupRepositories] WHERE [VeeamBackup].[dbo].[BackupRepositories].id = [linked_backup_repository_id]) as RepositoryName
FROM [VeeamBackup].[dbo].[LinkedBackupRepositories]


Repositories not linked to a tape job
Code: Select all
SELECT [id],[name]
FROM [VeeamBackup].[dbo].[BackupRepositories]
WHERE [VeeamBackup].[dbo].[BackupRepositories].[id]
NOT IN (select distinct [VeeamBackup].[dbo].[LinkedBackupRepositories].[linked_backup_repository_id] from [VeeamBackup].[dbo].[LinkedBackupRepositories])
tdewin
Veeam Software
 
Posts: 1046
Liked: 361 times
Joined: Fri Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin

Re: Get Repositories by Tape Jobs

Veeam Logoby Avshalom » Wed Apr 23, 2014 7:37 am

Hello tdewin,

I Haven't tried that yet, but thanks for your reply, i will update you soon if it's done the job..

cheers :)
Avshalom
Influencer
 
Posts: 18
Liked: never
Joined: Sun Mar 30, 2014 8:00 am
Full Name: Avshalom

Re: Get Repositories by Tape Jobs

Veeam Logoby v.Eremin » Wed Apr 23, 2014 7:55 am

It's not possible at the moment to get source settings of tape job via PowerShell. According to the plan, it should be addressed in the next product version. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 969 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get Repositories by Tape Jobs

Veeam Logoby Avshalom » Wed Apr 23, 2014 12:40 pm

tdewin, thanks it works for me throgh ssms,
good enough solution

v.Eremin thanks for your response, waiting for the next version,
cheers
Avshalom
Influencer
 
Posts: 18
Liked: never
Joined: Sun Mar 30, 2014 8:00 am
Full Name: Avshalom


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests