Skip to content

Instantly share code, notes, and snippets.

@numbata
Created January 23, 2012 08:55
Show Gist options
  • Select an option

  • Save numbata/1661879 to your computer and use it in GitHub Desktop.

Select an option

Save numbata/1661879 to your computer and use it in GitHub Desktop.

Revisions

  1. numbata revised this gist Jan 23, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rwt.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Грубые наброски
    # 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; $S*$EE/60"|bc`;echo "Estimated min: $ES . Speed: $S [ $TT / $EE ]"'
    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"'
  2. numbata created this gist Jan 23, 2012.
    4 changes: 4 additions & 0 deletions rwt.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    # Грубые наброски
    # 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; $S*$EE/60"|bc`;echo "Estimated min: $ES . Speed: $S [ $TT / $EE ]"'