#!/bin/sh
# * * * * * /opt/aimc/mysql4_uab/ck_mysql.sh
sys=`uname`
if [ "$sys" = "Linux" ];then
. ${HOME}/.bash_profile
else
. ${HOME}/.profile
fi
username=`id |cut -d"(" -f2|cut -d")" -f1`
mysqldir=mysql4_uab ## 唯一要修改的地方,默认mysql目录在当前用户目录下
ps -u ${username} -o comm| grep mysqld > /dev/null 2>&1
if [ $? -ne 0 ];then
cd /opt/aimc/mysql4_uab
./bin/mysqld_safe --defaults-file=/opt/aimc/mysql4_uab/.my.cnf &
echo "mysql restarted at `date`" >> ${HOME}/restart.log
fi
~
阅读(496) | 评论(0) | 转发(0) |