脚本代码如下:
#!/bin/bash                                                                                                                # Info   : check mysql slave                                                                                               # Author : dingtm                                                                                                          # CTime  : 2011.03.21                                                                                                      # This script run by root                                                                                                                                                                                                                             DBDir=/elain/apps/mysql/bin/                                                                                               DBSock=/elain/data/mysql/3306/mysql.sock                                                                                   Log=/tmp/mysql_slave.log                                                                                                   DBUser=root                                                                                                                DBPasswd=elain                                                                                                        MailList=elain@elain.org,elain2012@hotmail.com                                                                                                                                                                                                           Seconds_Behind_Master=$(${DBDir}mysql -u${DBUser} -p${DBPasswd} -S ${DBSock} -e "show slave status\G;" | awk -F':' '/Seconds_Behind_Master/{print $2}')                                                                                              
本文来自: 华盟黑客(中国最大黑客培训中心网站) 详细出处参考:http://www.hmhack.com/article/html/283.html

相关文章:

  • 2022-02-23
  • 2021-12-01
  • 2021-06-02
  • 2022-12-23
  • 2021-05-16
  • 2022-02-21
  • 2022-01-13
猜你喜欢
  • 2022-12-23
  • 2021-08-13
  • 2021-07-03
  • 2022-01-26
  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
相关资源
相似解决方案