I now want to run a Surebackup job on Saturday, after the last backup, that checks all the full backups and if successful, runs the robocopy task.
To accomplish this I was hoping to be able to schedule the Surebackup job to run after the last backup job, only on Saturday, but you can only specify after which job to run. That approach wasn't going to work so I wrote a short script that starts the Surebackup job as a post job activity for the last backup only Saturday. Now I only needed to add the Robocopy script to run after the Surebackup Job which I cannot because Surebackup doesn't have a post job activity.
Is it possible to continue running commands in the PS script after executing the Surebackup job?
Example:
Code: Select all
Add-PsSnapin VeeamPSSnapIn
$Job = Get-VBRJob -name "Server-et"
$StartTime = $Job.FindLastSession().CreationTime
If ($Job.GetLastresult() -eq "Warning" -or $Job.GetLastresult() -eq "Success")
{
$JobSurebackup = Get-VSBJob -name "SureBackup_1"
Start-VSBJob $JobSurebackup
>>Insert robocopy script here<<
}
ELSE
{
& 'c:\program files\veeam\scripts\sendmailfailed3.ps1'
}
Regards,
Vlad