检查计划任务的运行状况? [英] Check health of scheduled tasks?

查看:153
本文介绍了检查计划任务的运行状况?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近遇到一个问题,即在Windows升级和CF服务器重新启动后,ColdFusion计划任务未恢复。是否有一种方法来监视计划任务的健康状况,如果它们没有正常运行,会收到提醒?或者我需要编写一个任务来解析这些信息的日志文件。

We recently had an issue where a ColdFusion scheduled task didn't resume after a Windows upgrade and a CF server restart. Is there a way to monitor the health of scheduled tasks and be alerted if they are not running properly? Or would I need to write a task to parse the log files for that information?

推荐答案

您可以使用admin api有关预定任务的信息。以下内容返回一个结构数组,其中包含有关每个计划任务的信息。然后可以循环遍历数组并查看last_run变量。

you can use the admin api to get information on your scheduled tasks. the following returns an array of structures with info about each scheduled task. you can then loop through the array and look at the last_run variable.

<cfset arySchedTasks = createobject("java","coldfusion.server.ServiceFactory").getCronService().listall() />

这篇关于检查计划任务的运行状况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆