Get the last successful execution of a task or job - VisualCron - Forum

Community forum

IT-Direkt GmbH
2020-02-26T15:00:30Z
Hi,
is there a variable that contains the last successful and/or the last failure of a task or job execution?

Somthing like {TASK(Active|LastRunFailure|dd.MM.yyyy HH:mm)} or {TASK(Active|LastRunSuccess|dd.MM.yyyy HH:mm)}
Or any idea, how to find that date ?

Thanks in advance.

Mario
Support
2020-02-26T15:29:16Z
Originally Posted by: IT-Direkt GmbH 

Hi,
is there a variable that contains the last successful and/or the last failure of a task or job execution?

Somthing like {TASK(Active|LastRunFailure|dd.MM.yyyy HH:mm)} or {TASK(Active|LastRunSuccess|dd.MM.yyyy HH:mm)}
Or any idea, how to find that date ?

Thanks in advance.

Mario



Something like this? {TASK(Active|ExecutionTime|hh\:mm\:ss)}

Michael
Support
http://www.visualcron.com 

Please like  VisualCron on facebook!
IT-Direkt GmbH
2020-02-26T15:38:54Z
Hi Michael,
this variable gives me the "ExecutionTime" I guess. But no information about result of the task (failure or success).
I want to send a notification only when the task fails 2 times in a row - or only if the last successful run of the task is minimum 2 hours ago.
Any other ideas?
Support
2020-03-03T10:10:17Z
Originally Posted by: IT-Direkt GmbH 

Hi Michael,
this variable gives me the "ExecutionTime" I guess. But no information about result of the task (failure or success).
I want to send a notification only when the task fails 2 times in a row - or only if the last successful run of the task is minimum 2 hours ago.
Any other ideas?



Hi Mario,

Apologize for the late reply. Have you found any solution for this? If not I'll see if I can think of something better to help you regarding this.
Michael
Support
http://www.visualcron.com 

Please like  VisualCron on facebook!
IT-Direkt GmbH
2020-03-03T10:30:19Z
Hi Michael,
no, did not found any solution. The task is "I want to send a notification only when the task fails 2 times in a row"...
Best regards
Mario
Casper
2020-03-03T22:05:54Z
Originally Posted by: IT-Direkt GmbH 

Hi Michael,
no, did not found any solution. The task is "I want to send a notification only when the task fails 2 times in a row"...
Best regards
Mario



Hi, Mario! If you want send a notification after job fails 2 times, you can:
1. Create user variable "error_count" with default value 0
2. Create job "Increment error count" with task "Calculate variable" which will be Increment error_count+1 (every job fails)
3. Create job "Restore error count" with task "Set user variable" which will be set error_count variable to 0
4. Create notification
5. Create general job which will be run.
5.1. Add flow to job, when job completed successfully - run "Restore..." job
5.2. Add flow to job, when job completed with error - run "Increment..." job
5.3. Add flow to job, when job completed with error - check "error_count" variable, if it is equal to 2 then run notification.
IT-Direkt GmbH
2020-03-05T11:25:40Z
Hi Casper,
ok, looks like it will work. But I have to create for each task all the variables, jobs and flows, right?
Can you add a feature request for adding task and/or job related variables
{TASK(Active|LastRunFailure|dd.MM.yyyy HH:mm)}
{TASK(Active|LastRunSuccess|dd.MM.yyyy HH:mm)}
{JOB(Active|LastRunFailure|dd.MM.yyyy HH:mm)}
{JOB(Active|LastRunSuccess|dd.MM.yyyy HH:mm)}


Many Thanks in advance.
Mario
Support
2020-03-05T12:36:47Z
Originally Posted by: IT-Direkt GmbH 

Hi Casper,
ok, looks like it will work. But I have to create for each task all the variables, jobs and flows, right?
Can you add a feature request for adding task and/or job related variables
{TASK(Active|LastRunFailure|dd.MM.yyyy HH:mm)}
{TASK(Active|LastRunSuccess|dd.MM.yyyy HH:mm)}
{JOB(Active|LastRunFailure|dd.MM.yyyy HH:mm)}
{JOB(Active|LastRunSuccess|dd.MM.yyyy HH:mm)}


Many Thanks in advance.
Mario



You can clone them too,

As for feature request, it is a good idea. Please make the post/feature request in the feature request section
Also, thank you Casper for the clever suggestion on how to make that work.
Michael
Support
http://www.visualcron.com 

Please like  VisualCron on facebook!
Scroll to Top