Get-VBRTapeJob and last run time

PowerShell script exchange

Get-VBRTapeJob and last run time

Veeam Logoby npitacco » Wed Jun 24, 2015 7:53 am

Hello everyone.
I am writing some scripts to summarize the results of the jobs run in the last 24 hours for Veeam 7 (I know, I should upgrade)
I have no problem with standard backup jobs, but tape jobs are giving me weird results.
Dates do not match the one shown in the graphical interface, LatestRun is two years in the past and EndDateTime is next week :-(
When I look in the graphical interface I have:

Code: Select all
Job Name: File to Tape Job
Session type: FileTapebackup
Status: Success
Start Time: 6/21/2015 1:00 AM
End Time: 6/21/2015 10:17 AM


and this is the result of "Get-VBRJobScheduleOptions -Job "File to Tape Job" (I have shortened the schedule strings because I dont't believe they are relevant)

Code: Select all
OptionsScheduleAfterJob           : Veeam.Backup.Model.CScheduleAfterJobOptions
StartDateTime                          : 11/2/2013 4:51:01 PM
EndDateTimeSpecified              : False
EndDateTime                       : 6/26/2015 11:29:19 AM
RepeatSpecified                   : False
RepeatNumber                      : 1
RepeatTimeUnit                    : hour(s)
RepeatTimeUnitMs                  : 3600000
RetryTimes                        : 3
RetryTimeout                      : 10
RetrySpecified                    : True
WaitForBackupCompletion           : True
BackupCompetitionWaitingPeriodMin : 180
OptionsDaily                      : Enabled: True, DayNumberInMonth: Everyday, Days: Monday, Tuesday, Wednesday, Thursd
                                    ay, Friday, Saturday, Sunday
OptionsMonthly                    : Enabled: False, Time: 11/2/2013 10:00:00 PM, Day Number In Month: Fourth, Day Of We
                                    ek: Saturday, Months: January, February, March, April, May, June, July, August, Sep
                                    tember, October, November, December
OptionsPeriodically               : Enabled: False, Period: 1 hour(s), ScheduleString: <scheduler>...</scheduler>, HourlyOffset: 0
OptionsContinuous                 : Enabled: False, ScheduleString: <scheduler>...</scheduler>
OptionsBackupWindow               : Veeam.Backup.Model.CBackupWindowOptions
NextRun                           : 06/24/2015 20:00:00
LatestRun                         : [b]11/2/2013 4:46:01 PM[/b]
LatestRecheck                     : 1/1/0001 12:00:00 AM

The date "11/2/2013 4:51:01 PM" is when the job was created
My problem is the LatestRun value which is wrong.
Is this a known bug (but I have not seen it mentioned anywhere) or am I missing something?

Thanks in advance
Nadia
npitacco
Influencer
 
Posts: 12
Liked: never
Joined: Tue Jan 12, 2010 3:33 pm
Full Name: Nadia Pitacco

Re: Get-VBRTapeJob and last run time

Veeam Logoby v.Eremin » Wed Jun 24, 2015 9:20 am

What happens if you try to get it differently?

Code: Select all
$TapeJob = Get-VBRTapeJob -Name "Name of your tape job"
Get-VBRSession -Job $TapeJob -Last | select {$_.endtime}


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get-VBRTapeJob and last run time

Veeam Logoby npitacco » Mon Jul 20, 2015 3:01 pm

I apologize for the very late feedback, but I didn't receive the notification of your post.
I have tried the solution you suggested and it works.
I don't understand why, and this trouble me because without knowing the reason I cannot avoid other similar problems.

Thank you very much for pointing me to the right solution

Nadia
npitacco
Influencer
 
Posts: 12
Liked: never
Joined: Tue Jan 12, 2010 3:33 pm
Full Name: Nadia Pitacco

Re: Get-VBRTapeJob and last run time

Veeam Logoby v.Eremin » Tue Jul 21, 2015 9:05 am

Tape functionality has different set of its own commandlets. For instance, Get-VBRsession returns list of tape job sessions, thus, it should be used to get proper information regarding tape job last run. Other generic commandlets might or might not work for tape jobs smoothly.

This section of our help center might be a good starting point.

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 6 guests