Files
handy_scripts/showslavestats

3 lines
218 B
Plaintext
Raw Permalink Normal View History

2022-11-03 10:03:30 -04:00
#!/bin/bash
mysql -e 'SHOW SLAVE STATUS\G' | tee /dev/stderr | grep 'Seconds_Behind_Master' | cut -d':' -f2 | read seconds && eval "echo $(date -ud "@$seconds" +'$((%s/3600/24)) days %H hours %M minutes %S seconds')"