hanliu's personal blog

任何伟大都会被误解...Wiki Is All 注册 | 登陆
Contact me!

我,在某年某月来到这个世界。于某年某月创建了该BLOG,其间在BLOG的 10 个分类中发表的 513 篇文章被评论了 37 次。

利用计划任务使用批处理+php定时检查apache状态

建立bat批处理文件
@ECHO OFF php check.php if exist error.txt GOTO Normal if not exist error.txt GOTO Abort :Abort echo '无需操作'; GOTO END :Normal echo '重启'; 这里写上你的apache重启代码和其他一些需要的操作 GOTO END :END
check.php文件 该文件通过cli方式运行
php执行的时候会记录每次出现问题重启的时间。 把bat文件加为计划任务,根据实际需要决定监测的时间间隔。 建立bat批处理文件
@ECHO OFF php check.php if exist error.txt GOTO Normal if not exist error.txt GOTO Abort :Abort echo '无需操作'; GOTO END :Normal echo '重启'; 这里写上你的apache重启代码和其他一些需要的操作 GOTO END :END
check.php文件 该文件通过cli方式运行
php执行的时候会记录每次出现问题重启的时间。 把bat文件加为计划任务,根据实际需要决定监测的时间间隔。

« 上一篇 | 下一篇 »

Trackbacks

点击获得Trackback地址,Encode: UTF-8 点击获得Trackback地址,Encode: GB2312 or GBK 点击获得Trackback地址,Encode: BIG5

Leave a Comment

评论内容 (必填):