PowerShell script exchange
Post Reply
jchydro
Novice
Posts: 3
Liked: never
Joined: May 08, 2014 7:42 pm
Contact:

Scripting a report to match Backup Jobs to B2T jobs

Post by jchydro »

I'm looking to create a script that will generate and possible cross-check Backup Jobs in Veeam with their linked Backup to Tape jobs, in an effort to ensure there aren't any missed backups just expiring off disk.
Any direction with using get-vbrtapejob and get-vbrjob to generate lists to get me started would be appreciated :)
Thanks!
veremin
Product Manager
Posts: 20284
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Scripting a report to match Backup Jobs to B2T jobs

Post by veremin »

A quick question before we proceed to actual scripting - what is added as a source for a backup to tape job? Repository or individual backup/backup copy jobs? Thanks.
jchydro
Novice
Posts: 3
Liked: never
Joined: May 08, 2014 7:42 pm
Contact:

Re: Scripting a report to match Backup Jobs to B2T jobs

Post by jchydro »

All the Backup to Tape jobs use the Backup Jobs as sources - we don't have any just monitoring the repositories.
veremin
Product Manager
Posts: 20284
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Scripting a report to match Backup Jobs to B2T jobs

Post by veremin »

Try the following example and see whether it answers your requirements:

Code: Select all

asnp VeeamPSSnapin
$Objects = (Get-VBRTapeJob | ? {$_.Type -eq "BackupToTape"}).Object.name
$JobNames = (Get-VBRJob | where {$_.JobType -eq "Backup"}).name 
$JobNames | ?{$Objects -notcontains $_} 
Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests