x=0
while [ $x -lt 10 ]
do
expect <
spawn MySQL -u root -p -e "SHOW ENGINE INNODB STATUS\\\G"
expect "*password:"
send "123456\r"
expect eof
EOF
x=`expr $x + 1`
echo '#########################################################################' >> innodb_status.txt
sleep 60
done
网站标题:每隔30秒循环收集innodb状态信息的SHELL脚本(在脚本中自动输入密码)
标题URL:
http://cqcxhl.com/article/jeiopi.html