-
- Influencer
- Posts: 19
- Liked: 1 time
- Joined: Nov 12, 2011 11:43 am
- Contact:
Get job start time using Powershell
hello all,
basically want to get the start time of a running job as a variable, i've started off with something like below and now stuck,
$job = Get-VBRJob -Name "Some Job" | ? {$_.GetLastState() -eq "Working"}
so i could compare periodically with current time and if gt than x hrs, send an alert. i believe veeam alerts only get generated after reaching a state not while running ...
any advice?
thanks.
basically want to get the start time of a running job as a variable, i've started off with something like below and now stuck,
$job = Get-VBRJob -Name "Some Job" | ? {$_.GetLastState() -eq "Working"}
so i could compare periodically with current time and if gt than x hrs, send an alert. i believe veeam alerts only get generated after reaching a state not while running ...
any advice?
thanks.
-
- Veteran
- Posts: 282
- Liked: 26 times
- Joined: Nov 10, 2010 6:51 pm
- Full Name: Seth Bartlett
- Contact:
Re: Get job start time using Powershell
Code: Select all
$Job = Get-VBRJob -name "Name of Job"
$Job.ScheduleOptions.StartDateTime
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
-
- Influencer
- Posts: 19
- Liked: 1 time
- Joined: Nov 12, 2011 11:43 am
- Contact:
Re: Get job start time using Powershell
thanks seth .. all good.
i've noticed last state is $job.getlaststate(). where can i find all the variables for a job?
i've noticed last state is $job.getlaststate(). where can i find all the variables for a job?
-
- Veteran
- Posts: 282
- Liked: 26 times
- Joined: Nov 10, 2010 6:51 pm
- Full Name: Seth Bartlett
- Contact:
Re: Get job start time using Powershell
Code: Select all
$job | Gm
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
-
- Influencer
- Posts: 19
- Liked: 1 time
- Joined: Nov 12, 2011 11:43 am
- Contact:
Re: Get job start time using Powershell
thanks seth, can you explain a bit how to view options under each property, i tried,
$job = Get-VBRJob -name PER3SVR4-REPL
write-host $job.ScheduleOptions
but this does not list Job.ScheduleOptions.StartDateTime variable anywhere?
also wanted to know the variable for % completed when a job is active as well ..
just starting with poweershelll for veeam ...
$job = Get-VBRJob -name PER3SVR4-REPL
write-host $job.ScheduleOptions
but this does not list Job.ScheduleOptions.StartDateTime variable anywhere?
also wanted to know the variable for % completed when a job is active as well ..
just starting with poweershelll for veeam ...
-
- VP, Product Management
- Posts: 7081
- Liked: 1511 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
-
- Influencer
- Posts: 19
- Liked: 1 time
- Joined: Nov 12, 2011 11:43 am
- Contact:
Re: Get job start time using Powershell
thanks, jobcheduleOptions sorted.
where can i find variables for job statistics? particularly % completed during run time?
where can i find variables for job statistics? particularly % completed during run time?
-
- VP, Product Management
- Posts: 7081
- Liked: 1511 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Get job start time using Powershell
In this script you can find an example,
http://forums.veeam.com/viewtopic.php?f ... ing#p59844
If you delete –runasync from the run Job command, you will see a powershell % compleation bar.
http://forums.veeam.com/viewtopic.php?f ... ing#p59844
If you delete –runasync from the run Job command, you will see a powershell % compleation bar.
-
- Influencer
- Posts: 19
- Liked: 1 time
- Joined: Nov 12, 2011 11:43 am
- Contact:
Re: Get job start time using Powershell
thanks andreas.. i was more after a variable or a formula to get the % complete value of a running job which started by GUI scheduling (not initiated via a script). i am writing a script to email an alert when a job goes over x hrs.
is there a way to get the value using a calculation?
thanks.
is there a way to get the value using a calculation?
thanks.
Who is online
Users browsing this forum: No registered users and 10 guests