Windows Scheduled Task, Detecting Failure Programmatically
I'd like to develop a monitor to detect failed scheduled tasks and开发者_如何学运维 tasks that have run for over 'x' minutes. I'm looking for ideas to probe status of tasks and detect a failure code (or receive a status of running). I'd also like to verify the "stop running after 'x' hours" setting.
Have the scheduled task log its start time, end time, and end status in a database. All you need to do is query for the latest entries in the start and end tables to know the current status. As a bonus it gives you a history.
精彩评论