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脚本(在脚本中自动输入密码)
浏览路径:
http://kswsj.cn/article/jeiopi.html