PowerShell script exchange
Post Reply
Henrik.Grevelund
Service Provider
Posts: 171
Liked: 26 times
Joined: Feb 13, 2017 2:56 pm
Full Name: Henrik Grevelund
Contact:

How to find Agent SQL transaction log backup job results

Post by Henrik.Grevelund »

Hi There,

Have anyone figured out how to get the agent SQL transaction log backup job results(with powershell) ?

I would like to know the result of each backup interval.
Have nice day,
Henrik
soncscy
Veteran
Posts: 643
Liked: 312 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
Contact:

Re: How to find Agent SQL transaction log backup job results

Post by soncscy »

Hi Henrik,

Job objects have a method FindChildJobs() and a few other FindChild* methods.

FindChildSQLBackupJobs() should be what you need to get a Job id that you can pass to the various Get-*session cmdlets and I believe it will work!
Henrik.Grevelund
Service Provider
Posts: 171
Liked: 26 times
Joined: Feb 13, 2017 2:56 pm
Full Name: Henrik Grevelund
Contact:

Re: How to find Agent SQL transaction log backup job results

Post by Henrik.Grevelund »

Hi Harvey,

Unfortunally that only works with the get-vbrjob ID's.
It doesn't work with the ID's comming from the Get-VBRComputerBackupJob.
Have nice day,
Henrik
soncscy
Veteran
Posts: 643
Liked: 312 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
Contact:

Re: How to find Agent SQL transaction log backup job results

Post by soncscy » 1 person likes this post

Hi Henrik,

Indeed it is not part of the VbRComputerBackupJob object as a method; even though it's deprecated, until there's built-in functionality for this you can still use Get-VBRJob to retrieve agent jobs, then use:

$jobs.FindChildJobs().FindChildSQLLogBackupJob()

The first method retrieves what I believe is called a "worker" for the job, which is the Parent backup for the SQL log backup. Then you call FindChildSQLLogBackupJob() on the parent job.
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 669 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: How to find Agent SQL transaction log backup job results

Post by oleg.feoktistov »

That's right.
It doesn't work with the ID's comming from the Get-VBRComputerBackupJob.
Yes, because the hierarchy for agent jobs is a bit different:
Parent job - child job (job worker) - transaction logs backup job or else.

Thanks,
Oleg
soncscy
Veteran
Posts: 643
Liked: 312 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
Contact:

Re: How to find Agent SQL transaction log backup job results

Post by soncscy »

Hi Oleg,

Out of curiosity, is that the official hierarchy for agent jobs? (slightly off topic, but just curious)

https://helpcenter.veeam.com/docs/backu ... ml?ver=100

The user guide for Vmware backups lists the main job as parent and the "child" as the log backups, so I just assumed that the visible agent job had some title higher in the hierarchy. I get agent jobs are different, but should we understand the log backups as grandchildren (children of children) or is this purely semantics?
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 669 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: How to find Agent SQL transaction log backup job results

Post by oleg.feoktistov »

Hi Harvey,

I'd say it's purely semantics. Child jobs are more relevant to internal logic and separate for each agent. Usually, we are after parent jobs as these are what we see in the UI.

Thanks,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests