-
- Enthusiast
- Posts: 82
- Liked: 6 times
- Joined: May 01, 2012 3:00 pm
- Contact:
Result value from Backup Copy Jobs is always none
Whenever I run Get-VBRJob and look at my Backup Copy jobs the result is always "none"
Is there another place I can look to get the results of these jobs? I imagine it must be somewhere since the email alerts contain the information.
Thank you
Is there another place I can look to get the results of these jobs? I imagine it must be somewhere since the email alerts contain the information.
Thank you
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Result value from Backup Copy Jobs is always none
Have you tried to use .GetLastResult() function?
Thanks.
Code: Select all
asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your backup copy job"
$Job.GetLastResult()
-
- Novice
- Posts: 3
- Liked: 1 time
- Joined: Mar 23, 2016 9:02 am
- Full Name: Ola Danielsen
- Contact:
[MERGED]:Result value from Backup Copy Jobs is always none
How to get the result of a run copy job in powershell? If you use the regular parameter .GetLastResult() that give the correct status for a backup job, you get the answer "none" for a backup copy job,
like described in the thread linked below.
Is there another way to get the information whether last run finished correctly?
The reason for me wanting this information is because its easier to forget to check if the copy jobs are running like they should.
The previous a thread for this:
powershell-f26/result-value-from-backup ... 20512.html
like described in the thread linked below.
Is there another way to get the information whether last run finished correctly?
The reason for me wanting this information is because its easier to forget to check if the copy jobs are running like they should.
The previous a thread for this:
powershell-f26/result-value-from-backup ... 20512.html
-
- Product Manager
- Posts: 6551
- Liked: 765 times
- Joined: May 19, 2015 1:46 pm
- Contact:
Re: Result value from Backup Copy Jobs is always none
Hi,
Please do not create duplicate topics. I've just checked GetLastResult() and it works fine. What PowerShell and VBR versions are you running? Also please double check if the backup copy job that you've specified in your script did actually run at least once.
Thank you.
Please do not create duplicate topics. I've just checked GetLastResult() and it works fine. What PowerShell and VBR versions are you running? Also please double check if the backup copy job that you've specified in your script did actually run at least once.
Thank you.
-
- Novice
- Posts: 3
- Liked: 1 time
- Joined: Mar 23, 2016 9:02 am
- Full Name: Ola Danielsen
- Contact:
Re: Result value from Backup Copy Jobs is always none
Sorry about that. The idea was to make the topic shorter and I forgot that before I submitted it. When I remembered shortly after it was not possible to change it as it was a while impossible to find the post while it was waiting to get published.
Many moderators do like new post in old threads that was why I did not post in that thread.
We are running VBR version 8, and Powershell v.3 (remoting with New-PSSession). Remember that these threads are not about backup jobs (which works fine with GetLastResult() ), but backup copy jobs. Yes, the backup copy job has run many times (with success).
Many moderators do like new post in old threads that was why I did not post in that thread.
We are running VBR version 8, and Powershell v.3 (remoting with New-PSSession). Remember that these threads are not about backup jobs (which works fine with GetLastResult() ), but backup copy jobs. Yes, the backup copy job has run many times (with success).
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Result value from Backup Copy Jobs is always none
If my memory serves me well, only running backup copy job has None as its status, neither disabled nor idling job has the same status.
So, you might want to a simple check to your script. If the job is running, take previous session instead the latest one and check its result.
Thanks.
So, you might want to a simple check to your script. If the job is running, take previous session instead the latest one and check its result.
Code: Select all
asnp VeeamPSSnapin
$BCJ = Get-VBRJob -name "Name of your backup copy job"
if ($BCJ.GetLastResult() -ne "None"){$BCJ.GetLastResult()}
else {(Get-VBRBackupSession -Name $BCJ.name | sort -Descending)[1].Result}
-
- Novice
- Posts: 3
- Liked: 1 time
- Joined: Mar 23, 2016 9:02 am
- Full Name: Ola Danielsen
- Contact:
Re: Result value from Backup Copy Jobs is always none
Thank you very much! Get-VBRBackupSession solves this.
Then it will be:
or if you want it displayed nicely:
Then it will be:
Code: Select all
Get-VBRBackupSession | Where-Object {$_.OrigJobName -eq "Name of your copy job"}| Select-Object OrigJobName,EndTime,Result
Code: Select all
Get-VBRBackupSession | Where-Object {$_.OrigJobName -eq "Name of your copy job" -and $_.EndTime -ge (Get-Date).adddays(-7)}| Select-Object OrigJobName,EndTime,Result|ft
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Result value from Backup Copy Jobs is always none
You're welcome. If other questions arise, let me know. Thanks.
-
- Novice
- Posts: 5
- Liked: never
- Joined: Oct 14, 2016 11:59 am
- Full Name: Aumatics
- Contact:
[MERGED] Monitoring script
Hi,
I am working at a script which i can include in our monitoring tool prtg to check if the backups are having problems.
I come pretty far with get-vbrjobs and getting the "GetLastResult" value, but that does not work for Backup Copy Jobs and Cloud Backups, because they don't have a lastResult as they are continues backups. I am looking for a way to check if the backup copy jobs and Cloud Backups have a warning or error but i cant find it.
Does someone know how we can get this
I am working at a script which i can include in our monitoring tool prtg to check if the backups are having problems.
I come pretty far with get-vbrjobs and getting the "GetLastResult" value, but that does not work for Backup Copy Jobs and Cloud Backups, because they don't have a lastResult as they are continues backups. I am looking for a way to check if the backup copy jobs and Cloud Backups have a warning or error but i cant find it.
Does someone know how we can get this
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Result value from Backup Copy Jobs is always none
Check the script provided above; should meet answer requirements. Thanks.
-
- Veeam Software
- Posts: 1818
- Liked: 655 times
- Joined: Mar 02, 2012 1:40 pm
- Full Name: Timothy Dewin
- Contact:
[MERGED] Backup Copy Job Newest Result
It seems that if you use "get-vbrbackupsession" to query the last (newest) backup copy job session, the status will be always None (since the job is running in idle state/100% Progress but not done), even if everything is copied successfully. Is there any field/method that can be called to check "successful"-ness, or is the only way to do it by calculating yourself based on the VM result/100% Progress ?
For example (2 last sessions):
Result
For example (2 last sessions):
Code: Select all
$jobtype = "BackupSync"
#$jobtype = "Backup"
$Jobs = @(Get-VBRJob | ? { $_.JobType -ieq $jobtype }) | Sort-Object -Property Name
$allsessions = Get-VBRBackupSession | ? { $_.jobtype -ieq $jobtype }
$allorderdedsess = $allsessions | Sort-Object -Property CreationTimeUTC -Descending
foreach ($Job in $Jobs) {
$lastsessions = $allorderdedsess | ? { $_.jobname -eq $Job.Name } | select -First 2
if ($lastsessions -ne $null) {
$lastsessions | % {
$lastsession = $_;
write-host ("Name : {0} Last Result : {1} Date : {2}" -f $Job.Name,$lastsession.Result,$lastsession.CreationTime)
}
} else {
write-host ("Could not find Session for {0}" -f $Job.Name)
}
}
Name : Endpoint Backup Copy to Cloud Connect Last Result : None Date : 10/23/2016 10:00:36 PM
Name : Endpoint Backup Copy to Cloud Connect Last Result : Success Date : 10/22/2016 10:00:28 PM
Name : Hyper-V - Backup Copy to StoreOnce Last Result : None Date : 10/23/2016 10:04:08 PM
Name : Hyper-V - Backup Copy to StoreOnce Last Result : Failed Date : 10/22/2016 10:06:25 PM
Name : VMware - Backup Copy to Cloud Connect Last Result : None Date : 10/23/2016 10:00:36 PM
Name : VMware - Backup Copy to Cloud Connect Last Result : Success Date : 10/22/2016 10:00:28 PM
Name : VMware - Backup Copy to Cloud Connect with WAN Acceleration Last Result : None Date : 10/23/2016 10:00:09 PM
Name : VMware - Backup Copy to Cloud Connect with WAN Acceleration Last Result : Success Date : 10/22/2016 10:00:28 PM
Name : VMware - Backup Copy to DataDomain Last Result : None Date : 10/23/2016 10:00:09 PM
Name : VMware - Backup Copy to DataDomain Last Result : Success Date : 10/22/2016 10:00:28 PM
Name : VMware - Backup Copy to ExaGrid Last Result : None Date : 10/23/2016 10:00:09 PM
Name : VMware - Backup Copy to ExaGrid Last Result : Success Date : 10/22/2016 10:00:28 PM
Name : VMware - Backup Copy to StoreOnce Last Result : None Date : 10/23/2016 10:00:36 PM
Name : VMware - Backup Copy to StoreOnce Last Result : Success Date : 10/22/2016 10:00:28 PM
PS C:\Windows\system32>
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Result value from Backup Copy Jobs is always none
Why not to query a previous session if current one is in idle state? You cannot say anything definitive about session that hasn't finished yet. Thanks.
-
- Veeam Software
- Posts: 1818
- Liked: 655 times
- Joined: Mar 02, 2012 1:40 pm
- Full Name: Timothy Dewin
- Contact:
Re: Result value from Backup Copy Jobs is always none
Well the strange thing is, if you push the report (manually/gui/no-powershell) button in the ribbon, it will flag the session as Success. Also strange is that in case it is finished but Idle, the endtime will be different then 1/1/1900 12:00:00 AM
So I guess the only way to mimic this behaviour is:
-check all VMs status (if there is non pending)
-check the details per vm (messages)
-check the job details (messages)
-check if job status is none
-check if endtime is bigger then creationtime
-check if Progress.Percent is 100%
-check if Job is Idle
So I guess the only way to mimic this behaviour is:
-check all VMs status (if there is non pending)
-check the details per vm (messages)
-check the job details (messages)
-check if job status is none
-check if endtime is bigger then creationtime
-check if Progress.Percent is 100%
-check if Job is Idle
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Result value from Backup Copy Jobs is always none
I still think that it would be easier to either output these sessions in the report as idle ones or to take previous ones instead. However, if it's crucial for you to imitate Report button behaviour, you can stick to the described approach.
-
- Lurker
- Posts: 1
- Liked: never
- Joined: Aug 28, 2019 9:12 am
- Full Name: daniele
- Contact:
Re: Result value from Backup Copy Jobs is always none
Hello I have tested this script for valid my powershell script also for copy job
but $status in my case returns empty in case of copy job or returns Failed.
In reality the returned state has always been Success...
What am I doing wrong?
I'm using Veema backup & replication 9.5.4.2753
Code: Select all
$status = $job.GetLastResult()
if ($status -eq "None") {
$status = (Get-VBRBackupSession -Name $job.name | sort -Descending)[1].Result
}
In reality the returned state has always been Success...
What am I doing wrong?
I'm using Veema backup & replication 9.5.4.2753
Who is online
Users browsing this forum: No registered users and 9 guests