PowerShell script exchange
Post Reply
Anders
Enthusiast
Posts: 58
Liked: 13 times
Joined: Sep 09, 2010 9:45 am
Full Name: Anders Lorensen
Contact:

Tape job scheduling

Post by Anders »

Hi Experts

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
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Tape job scheduling

Post by veremin »

I've just tested it, and confirmed the described behaviour. Looks like a bug, indeed.

I'll double check whether the said bug is present in version 9, and let you know in accordance.

Speaking to "as new files appear" option, in case of one backup job being selected as a source for a tape job it won't make any difference from run "After this job" schedule option. The backup to tape job will sit and wait, till the backup job creates a backup file, and process that accordingly.

Thanks.
Anders
Enthusiast
Posts: 58
Liked: 13 times
Joined: Sep 09, 2010 9:45 am
Full Name: Anders Lorensen
Contact:

Re: Tape job scheduling

Post by Anders »

Any news on V9 and this issue?

I've just run the following script to change all my Tape jobs to eject the tape when complete:

Code: Select all

$vmlist = Get-VBRTapeJob
foreach ($job in $vmlist)
{
#Set-VBRBackupToTapeJob -Job $job -EjectCurrentMedium
}
This should not really alter the scheduling of a job - but it set all my tape jobs to "After []" instead of leaving it as "After <jobname>"
So it seems to be very related.

The workaround with using "When new files apear" did Work, but took up 2 CPU cores at 100% and 2 GB of ram for no extra functionality, so we decided to go with a manual method and change them all. - And now I have to do it manually again - on 131 tape jobs :cry:
(yes, I did test the script on a single job before I ran it on all - that job was just not scheduled, as it was a test job! :oops: )

Pretty Please fix this!
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Tape job scheduling

Post by veremin »

The information has been passed to the QA team. We're investigating the possibility of fixing it either in version 9 or the subsequent product updates. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests