ITPub博客

首页 > 数据库 > MySQL > 每隔30秒循环收集 innodb 状态信息的SHELL脚本(在脚本中自动输入密码)

每隔30秒循环收集 innodb 状态信息的SHELL脚本(在脚本中自动输入密码)

原创 MySQL 作者:lixiaxin200319 时间:2016-09-15 19:49:32 0 删除 编辑
x=0
while  [  $x -lt  10 ]
do
   expect <<eof
    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</eof

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/21582653/viewspace-2125021/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-02-10

  • 博文量
    66
  • 访问量
    208496