-
- Novice
- Posts: 7
- Liked: never
- Joined: Mar 19, 2021 10:49 am
- Full Name: Theo Gordon
- Contact:
Getting disabled/not scheduled jobs
Hey all,
I have a powershell script that gets jobs from Veeam and checks a number of things about them. One of these things is if the job is scheduled, not scheduled, or disabled.
However some job return commands, do not return the necessary information regarding scheduling/disabled:
Get-VBRTapeJob - Only returns if the job is enabled, this is false if disabled or not scheduled, is there anyway to make this distinction? I have used the command to view the scheduling options but there doesn't seem to be anything there to help.
Get-VBRComputerBackupCopyJob - Only has a "Next run" field, which is EMPTY if disabled or not scheduled, same question as with the GET-VBRTapeJob command.
Is there anyone who can help me out with this?
I have a powershell script that gets jobs from Veeam and checks a number of things about them. One of these things is if the job is scheduled, not scheduled, or disabled.
However some job return commands, do not return the necessary information regarding scheduling/disabled:
Get-VBRTapeJob - Only returns if the job is enabled, this is false if disabled or not scheduled, is there anyway to make this distinction? I have used the command to view the scheduling options but there doesn't seem to be anything there to help.
Get-VBRComputerBackupCopyJob - Only has a "Next run" field, which is EMPTY if disabled or not scheduled, same question as with the GET-VBRTapeJob command.
Is there anyone who can help me out with this?
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Getting disabled/not scheduled jobs
Hi Theo,
In VBRBackupToTapeJob class there actually are corresponding properties for that:
I am not sure though what kind of information you need about backup copy job scheduling. It is continuous no matter the copy mode: immediate or periodic. So, the notion of schedule being either enabled or disabled is not fully applicable here.
Please elaborate.
Thanks,
Oleg
In VBRBackupToTapeJob class there actually are corresponding properties for that:
Code: Select all
Get-VBRTapeJob | select Name, Enabled, @{n='ScheduleEnabled';e={$_.ScheduleOptions.Enabled}}
Please elaborate.
Thanks,
Oleg
-
- Novice
- Posts: 7
- Liked: never
- Joined: Mar 19, 2021 10:49 am
- Full Name: Theo Gordon
- Contact:
Re: Getting disabled/not scheduled jobs
Hi Oleg,
Thanks for the speedy reply! Unfortunately that doesn't solve my problem - a disabled job and a non-scheduled job both look the same from the output.
Disabled/NonScheduled jobs both return with Enabled - False, and a ScheduleEnabled - Blank
Thanks for the speedy reply! Unfortunately that doesn't solve my problem - a disabled job and a non-scheduled job both look the same from the output.
Disabled/NonScheduled jobs both return with Enabled - False, and a ScheduleEnabled - Blank
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Getting disabled/not scheduled jobs
Theo,
Which VBR version you are using? I just tested in v11 and here are the scenarios I reproduced with tape jobs:
1. Job enabled, schedule enabled. PS: Enabled: true, ScheduleEnabled: true
2. Job enabled, schedule disabled. PS: Enabled: false, ScheduledEnabled: false
3. Job disabled, schedule enabled. PS: Enabled: false, ScheduleEnabled: true
As I see, you cannot have disabled tape job with disabled scheduling simultaneously, so these are the possible scenarios.
2nd point looks confusing though, so I passed it to QA. Meanwhile, to differentiate disabled and non-scheduled jobs you can use simple validation:
Thanks,
Oleg
Which VBR version you are using? I just tested in v11 and here are the scenarios I reproduced with tape jobs:
1. Job enabled, schedule enabled. PS: Enabled: true, ScheduleEnabled: true
2. Job enabled, schedule disabled. PS: Enabled: false, ScheduledEnabled: false
3. Job disabled, schedule enabled. PS: Enabled: false, ScheduleEnabled: true
As I see, you cannot have disabled tape job with disabled scheduling simultaneously, so these are the possible scenarios.
2nd point looks confusing though, so I passed it to QA. Meanwhile, to differentiate disabled and non-scheduled jobs you can use simple validation:
Code: Select all
$jobs = Get-VBRTapeJob
foreach($job in $jobs) {
if ($job.Enabled -eq $false -and $job.ScheduleOPtions.Enabled -eq $false) {
$enabled = $true
$scheduleEnabled = $false
}
else {
$enabled = $job.Enabled
$scheduleEnabled = $job.ScheduleOptions.Enabled
}
$Job | select Name, @{n='Enabled';e={$enabled}}, @{n='ScheduleEnabled';e={$scheduleEnabled}}
}
Oleg
-
- Novice
- Posts: 7
- Liked: never
- Joined: Mar 19, 2021 10:49 am
- Full Name: Theo Gordon
- Contact:
Re: Getting disabled/not scheduled jobs
Hey Oleg,
Another speedy response! I'll look into this a bit more.
Would it make a difference between Backup to Tape, and File to Tape Backups?
Also, would I be able to see Enabled/Disabled and Scheduled for Windows Agent Backup Jobs?
Another speedy response! I'll look into this a bit more.
Would it make a difference between Backup to Tape, and File to Tape Backups?
Also, would I be able to see Enabled/Disabled and Scheduled for Windows Agent Backup Jobs?
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Getting disabled/not scheduled jobs
Since there is separate scheduling for full and incremental backups in FileToTape backup job, the properties to look for are $_.FullBackupPolicy.Enabled and $_.IncrementalBackupPolicy.Enabled. But yes, the algorithm is the same here.
For Windows Agent Backup Jobs it's a way simpler:
No discrepancies here.
Thanks!
For Windows Agent Backup Jobs it's a way simpler:
Code: Select all
Get-VBRComputerBackupJob | select Name, JobEnabled, ScheduleEnabled
Thanks!
-
- Novice
- Posts: 7
- Liked: never
- Joined: Mar 19, 2021 10:49 am
- Full Name: Theo Gordon
- Contact:
Re: Getting disabled/not scheduled jobs
Hi Oleg,
That's brilliant!! Final questions - what about for Get-VBRComputerBackupCopyJob? I can only see a NextRun for this? Also for Get-VBRJob, I can only see a IsScheduleEnabled?
That's brilliant!! Final questions - what about for Get-VBRComputerBackupCopyJob? I can only see a NextRun for this? Also for Get-VBRJob, I can only see a IsScheduleEnabled?
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Getting disabled/not scheduled jobs
Theo,
How can you enable/disable schedule for a backup copy job if it runs continuously? It just synchronises with a primary job from time to time. So, it's just NextRun property. Or do you mean specific times, when backup copy job is not allowed to run?
As for Get-VBRJob cmdlet output:
- IsScheduleEnabled - corresponds to job: enabled/disabled
- Options.JobOptions.RunManually - corresponds to schedule: enabled/disabled
Thanks,
Oleg
How can you enable/disable schedule for a backup copy job if it runs continuously? It just synchronises with a primary job from time to time. So, it's just NextRun property. Or do you mean specific times, when backup copy job is not allowed to run?
As for Get-VBRJob cmdlet output:
- IsScheduleEnabled - corresponds to job: enabled/disabled
- Options.JobOptions.RunManually - corresponds to schedule: enabled/disabled
Thanks,
Oleg
-
- Novice
- Posts: 7
- Liked: never
- Joined: Mar 19, 2021 10:49 am
- Full Name: Theo Gordon
- Contact:
Re: Getting disabled/not scheduled jobs
Hi Oleg,
Thanks a lot for all this! I understand your comment, however there should surely be a way to check if the Get-VBRComputerBackupCopyJob jobs have been disabled or not though?
Also for File to Tape jobs, I'm noticing the job is marked as disabled when it does not have a schedule, even though the job is not disabled in Veeam.
Am I missing something with Veeam here?
Thanks a lot for all this! I understand your comment, however there should surely be a way to check if the Get-VBRComputerBackupCopyJob jobs have been disabled or not though?
Also for File to Tape jobs, I'm noticing the job is marked as disabled when it does not have a schedule, even though the job is not disabled in Veeam.
Am I missing something with Veeam here?
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Getting disabled/not scheduled jobs
Hi Theo,
Sure, there is. As in case with Get-VBRComputerBackupJob, you are after JobEnabled property.
As for FileToTape job state, it looks like a bug specific to tape jobs. Already passed it to QA.
Thanks,
Oleg
Sure, there is. As in case with Get-VBRComputerBackupJob, you are after JobEnabled property.
As for FileToTape job state, it looks like a bug specific to tape jobs. Already passed it to QA.
Thanks,
Oleg
-
- Novice
- Posts: 7
- Liked: never
- Joined: Mar 19, 2021 10:49 am
- Full Name: Theo Gordon
- Contact:
Re: Getting disabled/not scheduled jobs
Hi Oleg,
I was talking about Get-VBRComputerBackupCopyJob, not Get-VBRComputerBackupJob, is there a way to see if the job is enabled for those?
Thanks for your help with this, could you keep me updated as to when a fix is rolled out?
I was talking about Get-VBRComputerBackupCopyJob, not Get-VBRComputerBackupJob, is there a way to see if the job is enabled for those?
Thanks for your help with this, could you keep me updated as to when a fix is rolled out?
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Getting disabled/not scheduled jobs
Theo,
Please re-read my comment. I meant that cases for both cmdlets are the same:
The fix will be available no sooner than vNext, and I mean major version.
Best regards,
Oleg
Please re-read my comment. I meant that cases for both cmdlets are the same:
Code: Select all
Get-VBRComputerBackupCopyJob | Select JobEnabled
Best regards,
Oleg
-
- Novice
- Posts: 7
- Liked: never
- Joined: Mar 19, 2021 10:49 am
- Full Name: Theo Gordon
- Contact:
Re: Getting disabled/not scheduled jobs
Hi Oleg,
My mistake, however that still returns an empty field when tested.
Cheers,
Theo
My mistake, however that still returns an empty field when tested.
Cheers,
Theo
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Getting disabled/not scheduled jobs
This is weird and not expected. I could reproduce it only in case with immediate agent backup copy jobs and only for first few minutes after job creation. After that, the value is reflected correctly. I'd advise you to submit a support case. Please share the case id here for further follow-up. Thanks!
Who is online
Users browsing this forum: No registered users and 16 guests