Created
May 6, 2019 03:38
-
-
Save imvkmark/0dffcd8dd16533bf6e7fa02aa399a42c to your computer and use it in GitHub Desktop.
线上服务器发送慢日志
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/bin/sed -n "/# Time: `date +%F`/,/# Time: `date +%F`/"p /var/lib/mysql/iZ28gwro9uqZ-slow.log > /tmp/slow-select.log | |
/usr/local/bin/mysqlsla --log-type slow --sort c_sum /tmp/slow-select.log > /tmp/slow-select.txt | |
python /var/lib/mysql-slow/sendemail.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment