Skip to content

Instantly share code, notes, and snippets.

@numbata
Created January 23, 2012 08:55
Show Gist options
  • Save numbata/1661879 to your computer and use it in GitHub Desktop.
Save numbata/1661879 to your computer and use it in GitHub Desktop.
MySQL replcation waiting estimated time
# Грубые наброски
# 1327306923
# 217341
watch -n 2 'E=`mysql -u root -A -e "show slave status \G" | grep "Seconds_Behind_Master" | grep -o -E "[0-9]+"`;T=`date +%s`;TT=`expr 217341 - $E`;EE=`expr $T - 1327306923`;S=`echo "scale=2; $TT/$EE"|bc`;ES=`echo "scale=2; $E/$S/60"|bc`;echo "Estimates minutes: $ES . Speed: $S"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment