- Replication lag script adopted from https://www.percona.com/blog/2012/08/29/heres-a-quick-way-to-foresee-if-replication-slave-is-ever-going-to-catch-up-and-when/
- minor tweak required: use
mawk
instead ofawk
- Encrypted mysql credentials configured with https://dev.mysql.com/doc/refman/5.7/en/mysql-config-editor.html
- minor tweak required: use
delay=60
cmd="mysql -e 'show slave status\G' | grep Seconds_Behind_Master | awk '{print \$2}'"
while sleep $delay; do eval $cmd; done | mawk -W interactive -v delay=$delay '
{
passed += delay;