Scripting a report to match Backup Jobs to B2T jobs

PowerShell script exchange

Scripting a report to match Backup Jobs to B2T jobs

Veeam Logoby jchydro » Tue Aug 09, 2016 8:22 pm

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!
jchydro
Novice
 
Posts: 3
Liked: never
Joined: Thu May 08, 2014 7:42 pm

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

Veeam Logoby v.Eremin » Wed Aug 10, 2016 11:10 am

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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

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

Veeam Logoby jchydro » Wed Aug 10, 2016 6:20 pm

All the Backup to Tape jobs use the Backup Jobs as sources - we don't have any just monitoring the repositories.
jchydro
Novice
 
Posts: 3
Liked: never
Joined: Thu May 08, 2014 7:42 pm

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

Veeam Logoby v.Eremin » Wed Aug 10, 2016 7:14 pm

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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests