Job Stopped by User

PowerShell script exchange

Job Stopped by User

Veeam Logoby brupnick » Tue Jan 03, 2012 5:09 pm

Good afternoon-

Is there a way via Powershell to tell that a VBR job was stopped by a user (via the GUI)? I have a script that automatically retries if the status is "Failed", but I don't want this to happen if the status is "Failed" because a user intentionally stopped a job.

Thank you!
Brian
brupnick
Expert
 
Posts: 196
Liked: 13 times
Joined: Sat Feb 05, 2011 5:09 pm
Location: New York, USA
Full Name: Brian Rupnick

Re: Job Stopped by User

Veeam Logoby Gostev » Tue Jan 03, 2012 7:49 pm

Hi Brian, I don't believe this is possible via PowerShell...
Gostev
Veeam Software
 
Posts: 21390
Liked: 2349 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Job Stopped by User

Veeam Logoby ThomasMc » Tue Jan 03, 2012 8:15 pm

Via the logs?

Code: Select all
PS C:\> $session = Get-VBRBackupSession | Sort CreationTime -Descending | Select -First 1
PS C:\> $log = $session.Logger.GetLog()
PS C:\> $log.UpdatedRecords

Status      : EFailed
OrdinalId   : 7
UpdateUsn   : 0
Title       : Job finished with error at 03/01/2012 20:10:00
Description :
UpdateTime  : 03/01/2012 20:10:00
Style       : ENone
Object      :
StartTime   : 03/01/2012 20:10:00
Cookie      : NoReport

Status      : EFailed
OrdinalId   : 6
UpdateUsn   : 0
Title       : Job has been terminated
Description :
UpdateTime  : 03/01/2012 20:10:00
Style       : ENone
Object      :
StartTime   : 03/01/2012 20:10:00
Cookie      :
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: Job Stopped by User

Veeam Logoby Gostev » Tue Jan 03, 2012 8:52 pm

Thing is, there are also automated job terminations, and I don't believe those are distinguished from termination by user. However, if backup window enforcement is not enabled, then this might work.
Gostev
Veeam Software
 
Posts: 21390
Liked: 2349 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Job Stopped by User

Veeam Logoby ThomasMc » Wed Jan 04, 2012 4:05 pm

Good point Anton :)
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: Job Stopped by User

Veeam Logoby Gostev » Wed Jan 04, 2012 8:40 pm

On a second thought though, presumably you should not want the job to be retried once it was terminated due to running out of the allowed backup window ;)
Gostev
Veeam Software
 
Posts: 21390
Liked: 2349 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 3 guests