-
- Enthusiast
- Posts: 39
- Liked: 9 times
- Joined: Apr 07, 2017 7:08 pm
- Contact:
Getting Job Schedules, Start, last run, and next run
I am using Get-VBRJob and parsing out the ScheduleOptions to get a variety of data on the jobs but I am noticing that the NextRun, LatestRunLocal, and StartDateLocalTime all return an incorrect date but do give the correct time.
It does this for all the jobs I check.
I also get the same results with Get-VBRJobScheduleOptions.
When I log into the Database schema and check the View dbo.JobsView the XML stored in schedules field has all the correct data.
Any idea why those cmdlets would be returning bad dates?
Thanks!
It does this for all the jobs I check.
I also get the same results with Get-VBRJobScheduleOptions.
When I log into the Database schema and check the View dbo.JobsView the XML stored in schedules field has all the correct data.
Any idea why those cmdlets would be returning bad dates?
Thanks!
-
- Veteran
- Posts: 1143
- Liked: 302 times
- Joined: Apr 27, 2020 12:46 pm
- Full Name: Natalia Lupacheva
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
Hi William,
Could you please clarify what's exactly incorrect?
If we are talking about date format, this thread might help you to solve this issue (you can take a look at the workaround for date formatting).
If it's not about the date formatting, please give us some details.
Thanks!
Could you please clarify what's exactly incorrect?
If we are talking about date format, this thread might help you to solve this issue (you can take a look at the workaround for date formatting).
If it's not about the date formatting, please give us some details.
Thanks!
-
- Enthusiast
- Posts: 39
- Liked: 9 times
- Joined: Apr 07, 2017 7:08 pm
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
Here is some test code I have been using plus the results returned.
======================
=======================
I would expect the NextRun to be 8/24/2020 23:55:00 as the job runs daily
and the LastRunLocal to 8/23/2020 23:55:00 since that is when it last ran.
======================
Code: Select all
$jobName = "backupjob1"
$temp = Get-VBRJob -name $jobName
$temp.ScheduleOptions
<...removed lines....>
StartDateTimeLocal : 4/2/2020 11:55:00 PM
EndDateTimeSpecified : False
EndDateTimeLocal : 4/4/2020 8:01:55 AM
<...removed lines....>
NextRun : 04/23/2020 23:55:00
LatestRunLocal : 4/22/2020 11:55:13 PM
<...removed lines....>
I would expect the NextRun to be 8/24/2020 23:55:00 as the job runs daily
and the LastRunLocal to 8/23/2020 23:55:00 since that is when it last ran.
-
- Veteran
- Posts: 1143
- Liked: 302 times
- Joined: Apr 27, 2020 12:46 pm
- Full Name: Natalia Lupacheva
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
Hi William,
sorry for late response.
So there's not a formatting issue and the dates you get via Powershell commands don't even match the information you see in VBR, right?
In that case it's better to open a Support ticket, because it doesn't seem to be some known issue.
Thanks!
sorry for late response.
So there's not a formatting issue and the dates you get via Powershell commands don't even match the information you see in VBR, right?
In that case it's better to open a Support ticket, because it doesn't seem to be some known issue.
Thanks!
-
- Enthusiast
- Posts: 39
- Liked: 9 times
- Joined: Apr 07, 2017 7:08 pm
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
Thank you Natalia I will get a case opened.
-
- Enthusiast
- Posts: 39
- Liked: 9 times
- Joined: Apr 07, 2017 7:08 pm
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
Got a quick response that this is a known issue and that they are working on getting a fix scheduled for v11 or possibly a hotfix, depending.
As a work around they suggest using the LatestRun data within the LatestRunLocal property of Veeam.Backup.Core.CBackupJob
As a work around they suggest using the LatestRun data within the LatestRunLocal property of Veeam.Backup.Core.CBackupJob
-
- Veteran
- Posts: 1143
- Liked: 302 times
- Joined: Apr 27, 2020 12:46 pm
- Full Name: Natalia Lupacheva
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
Hi William,
Thank you for the follow-up! Appreciate it.
Thanks!
Thank you for the follow-up! Appreciate it.
Thanks!
-
- Expert
- Posts: 111
- Liked: 16 times
- Joined: Dec 10, 2018 10:59 am
- Full Name: Robert Atkinson
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
Any update on a fix for this one?
Cheers, Rob.
Cheers, Rob.
-
- Veteran
- Posts: 1143
- Liked: 302 times
- Joined: Apr 27, 2020 12:46 pm
- Full Name: Natalia Lupacheva
- Contact:
-
- Expert
- Posts: 111
- Liked: 16 times
- Joined: Dec 10, 2018 10:59 am
- Full Name: Robert Atkinson
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
From what I can see, LatestRunLocal holds the last time it was run, not when it's going to be run?
PS C:\Users\Rob> $A = Get-VBRJob -name PROD_DAILY_COL_FILE_BACKUP
PS C:\Users\Rob> $A.LatestRunLocal
22 November 2020 21:00:02
PS C:\Users\Rob> $A = Get-VBRJob -name PROD_DAILY_COL_FILE_BACKUP
PS C:\Users\Rob> $A.LatestRunLocal
22 November 2020 21:00:02
-
- Veeam Vanguard
- Posts: 282
- Liked: 113 times
- Joined: Apr 20, 2017 4:19 pm
- Full Name: Joe Houghes
- Location: Castle Rock, CO
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
Correct, LatestRunLocal is the most recent past job run.
You need to be looking at the NextRun property.
You need to be looking at the NextRun property.
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
-
- Expert
- Posts: 111
- Liked: 16 times
- Joined: Dec 10, 2018 10:59 am
- Full Name: Robert Atkinson
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
NextRun is the one that doesn't work though, or is there another NextRun property somewhere else?
PS C:\Windows\system32> $A = Get-VBRJob -name PROD_DAILY_COL_FILE_BACKUP
PS C:\Windows\system32> $A.ScheduleOptions
NextRun : 11/10/2020 21:00:00
PS C:\Windows\system32> $A = Get-VBRJob -name PROD_DAILY_COL_FILE_BACKUP
PS C:\Windows\system32> $A.ScheduleOptions
NextRun : 11/10/2020 21:00:00
-
- Veeam Vanguard
- Posts: 282
- Liked: 113 times
- Joined: Apr 20, 2017 4:19 pm
- Full Name: Joe Houghes
- Location: Castle Rock, CO
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
Gotcha, hadn't realized that property had a problem. Apologies on that.
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
-
- Expert
- Posts: 111
- Liked: 16 times
- Joined: Dec 10, 2018 10:59 am
- Full Name: Robert Atkinson
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
I was struggling to implement the workaround for this issue, so here are the 2 options available for anyone else tackling the same problem.
Code: Select all
PS > $a = Get-VBRJob -name "PROD_DAILY_FILE_BACKUP"
PS > $a.GetScheduleOptions() | select NextRun, LatestRunLocal
NextRun LatestRunLocal
------- --------------
25/11/2020 20:00:00 24/11/2020 20:00:25
PS > Get-VBRJobScheduleOptions -job $a | select NextRun, LatestRunLocal
NextRun LatestRunLocal
------- --------------
25/11/2020 20:00:00 24/11/2020 20:00:25
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
Hi Robert,
Actually, the issue was fixed in v10 a with Get-VBRJobScheduleOptions, which is a synonym for GetScheduleOptions() method. So, as I see above, you succeeded in retrieving these properties.
Best regards,
Oleg
Actually, the issue was fixed in v10 a with Get-VBRJobScheduleOptions, which is a synonym for GetScheduleOptions() method. So, as I see above, you succeeded in retrieving these properties.
Best regards,
Oleg
-
- Expert
- Posts: 111
- Liked: 16 times
- Joined: Dec 10, 2018 10:59 am
- Full Name: Robert Atkinson
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
Thanks for the additional info Oleg. I wasn't aware Get-VBRJobScheduleOptions is a new (v10) cmdlet.
Rob.
Rob.
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Getting Job Schedules, Start, last run, and next run
It is pretty ancient, actually. We just fixed the issue with incorrect values in v10a in scope of this cmdlet. Thanks!I wasn't aware Get-VBRJobScheduleOptions is a new (v10) cmdlet.
Who is online
Users browsing this forum: No registered users and 8 guests