PowerShell script exchange
Post Reply
ThoKar
Lurker
Posts: 1
Liked: never
Joined: Apr 12, 2018 1:37 pm
Contact:

Job Script - query to get merge-finished

Post by ThoKar »

Hi folks.
I'm figuring an issue with an post-job PS-script of a Reverse-Incremental Backup-Job of a VMware-Host.
This post-job script is been started by a link-batch in the backup-job and looks as follows:

Code: Select all

Start-Sleep -S 60
Add-PSSnapin VeeamPSSnapin
if (get-command | Where-Object {$_.Name -eq "Connect-VBRServer"}) {Connect-VBRServer -Server $env:VEEAMSERVER}
$VBRBackupJobName = "BackupJob"
$VBRLastBackupSuccess = (Get-VBRJob | where {$_.Name -eq $VBRBackupJobName}).GetLastResult() -eq "Success" -OR (Get-VBRJob | where {$_.Name -eq $VBRBackupJobName}).GetLastResult() -eq "Warning"
if(!$VBRLastBackupSuccess){invoke-item "C:\scripts\sync_backup.cmd"}
else{Exit Script}
The script runs after a Full-Backup without issues. After the Reverse-Incremental however, the script won't come up. My suggestion is that the merging is still in progress or the script cannot get the "Success" propperly. I've tried to adust the start-sleep-time but nevertheless it won't start.
My idea is now to build some kind of query that checks the merging to be finished bevor going on.

Has anyone faced a similar problem and has an idea how i could build something like that? Or maybe have some advice?

Thanks in advance
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests