Quantcast
Channel: R&D Forums
Viewing all articles
Browse latest Browse all 9920

PowerShell • Get running Offload jobs for X number of days and terminate them

$
0
0
Some time ago we had issues with Cloudconnect Offloading jobs which kept piling up. We had to manually kill them trough the task manager, but there is no indication which job is what.

I was thinking of putting a script together to automate this, should this come back in the future.
I have found some usable snippets of code from following forum posts:
powershell-f26/how-to-manage-jobs-in-th ... 86341.html
powershell-f26/sobr-azure-offload-statu ... 65880.html

I currently have this incomplete non working code:

Code:

#Connect to VBRConnect-VBRServer#Define SOBR offload job  = Archivebackup$sobrOffload = [Veeam.Backup.Model.EDbJobType]::ArchiveBackup#Get running SOBR offload jobs$runningSessionsArchiveBackup = [Veeam.Backup.Core.CBaseSession]::GetRunning($sobrOffload)#write $runningSessionsArchiveBackup$runningSessionsArchiveBackupOlderThan7days= [Veeam.Backup.Core.CBackupSession]::GetByTypeAndTimeInterval($runningSessionsArchiveBackup,(Get-Date).adddays(-7), (Get-Date).adddays(1)) write $runningSessionsArchiveBackupOlderThan7days
It seems you cannot mix EDBJobType and GetByTypeAndTimeInterval according to the error:
Cannot convert argument "jobType", with value: "Veeam.Backup.Model.CBaseSessionInfo[]", for "GetByTypeAndTimeInterval" to type "Veeam.Backup.Model.EDbJobT
ype": "Cannot convert the "Veeam.Backup.Model.CBaseSessionInfo" value of type "Veeam.Backup.Model.CBaseSessionInfo" to type "Veeam.Backup.Model.EDbJobType
"."


The goal here is to get the running SOBR Offload jobs, for example 7 days, and terminate the ones older than a given time.

If anyone can aid me in this, I would be very grateful

Statistics: Posted by JeroenConfirmed — May 06, 2025 8:17 am



Viewing all articles
Browse latest Browse all 9920

Latest Images

Trending Articles



Latest Images