监控mysqlreport的shell脚本

#!/bin/bash
if [ "$1" == "" ]
then
 echo "Please input mysqld port number 21001-21007"


elif ([ "$1" != "21001" ] && [ "$1" != "21002" ] && [ "$1" != "21003" ]&& [ "$1" != "21004" ] && [ "$1" != "21005" ] && [ "$1" != "2
1006" ]  && [ "$1" != "21007" ])
then
 echo "Please input mysqld port number 21001-21007"


else
while(true)
 do
   ./mysqlreport --user=root --password=@123456 --socket=/usr/local/mysql/tmp/mysql-$1.sock >report.log
   sed '76,122d' report.log  //由于我使用的 MyISAM引擎,在这里我过滤了所有的InnoDB信息
   rm -fr report.log
   sleep $2
   echo -e '\n'
   echo "##########################################################################################################################"
   echo -e  '\n' 
done


fi
~           

你可能感兴趣的:(shell,脚本,input,引擎)