I have to create 131 tape jobs, and would love some automation to do that...
Each job will have a Veeam backup job as a source, and a Media pool as destination. the media pool depends on the job name. The Tape job should start when the backup job finishes. Pretty simple straight forward imho.
I've created the following script for it:
Code: Select all
$JobName = "MyJob-tst"
$TapeJobName = "MyJob-tst-tpe"
if ($JobName -match "-prd") {$MediaPoolName = Get-VBRTapeMediaPool -Name PRD}
if ($JobName -match "-tst") {$MediaPoolName = Get-VBRTapeMediaPool -Name TST}
if ($JobName -match "-udv") {$MediaPoolName = Get-VBRTapeMediaPool -Name UDV}
if ($JobName -match "-pp") {$MediaPoolName = Get-VBRTapeMediaPool -Name PP}
$ObjToBackupToTape = Get-VBRJob -Name $JobName
$ScheduleAfterJob = New-VBRBackupToTapeScheduleOptions -Type AfterJob -Job $ObjToBackupToTape -Enabled
Add-VBRBackupToTapeJob -Name $TapeJobName -FullBackupMediaPool $MediaPoolName -IncrementalBackupMediaPool $MediaPoolName -ProcessIncrementalBackup -Object $ObjToBackupToTape -ScheduleOptions $ScheduleAfterJob
This works to a point. It creates the job, picks the right media pool. But the scheduling option is not working. The gui shows its "After job" and the job name shows as [] - as in no job name.
What am I doing wrong?
What is the difference between "After this Job" and "As new backup files apear" in this case, where the source of the job only contain 1 backup job. Will Veeam use more rescources on the "new files apear"? (I ask, because I can see that as a workaround/solution to my problem)
Thanks,
Anders