PowerShell script exchange
Post Reply
Etilimos30
Novice
Posts: 8
Liked: never
Joined: Jun 15, 2022 12:11 pm
Full Name: Etilimos
Contact:

Rapport Agent CopyJob

Post by Etilimos30 »

Hello,

I recently set up a VBR server that manages the backup of physical servers via jobs (backup on local disk) + copyjob (export to our DC). The copyjobs are configured in "continuous" mode. I would like to create a report that allows me to get the status of the last copyjob (success, error, warning or in progress). I had managed to do this in powershell but I found myself with anomalies because VBR returns an error in "LastResult" while when I open the session the backup is successful.

Image

Here is the query I created with SQL but it doesn't show me all the copyjobs

Code: Select all

DECLARE @yesterday AS datetime
SET @yesterday = (select dateadd(d,-1,getdate()))
DECLARE @today AS datetime
SET @today = (select getdate())

select max(end_time) as MaxTime, job_name, success, failed, warning, inprogress
FROM [VeeamBackup].[dbo].[ReportSessionView]
where creation_time > @yesterday
AND end_time < @today
and job_source_type = 5
AND end_time <> '1900-01-01 00:00:00.000'
--AND state <> 9
GROUP BY job_name, success, failed, warning, inprogress
order BY job_name DESC
Would you have an idea ?
Mildur
Product Manager
Posts: 9846
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Rapport Agent CopyJob

Post by Mildur »

Hi Etilimos

With backup copy jobs in the periodic mode (=continuous), the "Last Result" of the entire backup copy job will only be "Success" if there was no issue in the last interval. If there was a failure in copying a backup in the last interval, you will see for the following interval the job as failed.

Using custom MSSQL query's in the Veeam configuration database is not supported, so I don't have an answer for using that query.

Thanks
Fabian
Product Management Analyst @ Veeam Software
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests