一个简单的Shell脚本,通过`pgrep`检查`mysqld`进程,如果未运行则执行`rememory.sh`脚本来重启MySQL服务,最后调用`/etc/init.d/mysqldstart`。
脚本代码
pgrep -x mysqld &> /dev/null if [ $? -ne 0 ];then bash /www/server/panel/script/rememory.sh /etc/init.d/mysqld start fi
文章采用创作共用版权 CC BY-NC-ND/2.5/CN 许可协议,与本站观点无关。
如果您认为本文侵犯了您的版权信息,请与我们联系修正或删除。 投诉邮箱wpsite@aliyun.com