建立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文件加为计划任务,根据实际需要决定监测的时间间隔。