Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the SHELL script that collects the status information of MYSQL standby database every 30 seconds?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to achieve a cycle every 30 seconds to collect MYSQL standby database status information of the SHELL script, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor with you to understand.

Slave_status.sh

Xerox 0

While [$x-lt 50]

Do

Mysql-u root-proot_tcl-e "show slave status\ G" > > slave_status.txt

X = `expr $x + 1`

Echo'#'> slave_status.txt

Sleep 10

Done

The following script uses expect to automatically enter a password in the script

Xerox 0

While [$x-lt 50]

Do

Expect slave_status.txt

Sleep 10

Done

Thank you for reading this article carefully. I hope the article "how to realize the SHELL script of collecting MYSQL standby status information every 30 seconds" shared by the editor is helpful to everyone. At the same time, I also hope you can support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report