powershell script for backup time

PowerShell script exchange

powershell script for backup time

Veeam Logoby ThinkGrid » Tue Apr 08, 2014 2:28 pm

Hi guys

Is there any powershell script I can apply that would tell me if a Job has been running for more than 12 hours. I just want to be alerted rather than stop the job

Thanks
Petrit
ThinkGrid
Enthusiast
 
Posts: 55
Liked: 2 times
Joined: Mon Jul 11, 2011 10:18 am

Re: powershell script for backup time

Veeam Logoby v.Eremin » Tue Apr 08, 2014 2:35 pm 1 person likes this post

Have you considered Veeam ONE alerting system for that purpose; might be exactly what you're looking for? Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: powershell script for backup time

Veeam Logoby ehrnst » Wed Apr 09, 2014 11:55 am

This could probably get you going, just change the "totalhours" to be greather than. I did not have any jobs that have ben running for more than 20 minutes

Code: Select all
Get-VBRJob | Where {($_.GetLastState() -eq "Working") -and (((Get-Date) - $_.FindLastSession().CreationTime).TotalHours -lt '1')} | Select name, @{N="Start Time";E={($_.FindLastSession().CreationTime)}}, @{N="Status";E={($_.GetLastState())}}
ehrnst
Enthusiast
 
Posts: 35
Liked: 1 time
Joined: Fri Jan 31, 2014 8:24 am
Full Name: Martin Ehrnst


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests