#!/usr/local/bin/bash
# Author: LG <[email protected]>
PATH=/usr/local/mysql/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
export PATH
_relay=`hostname |awk -F. '{print }'`
_relay_log="$_relay-relay-bin.*"
function replication()
{
_secB=`ls -l /usr/local/mysql/var/$_relay_log|grep -v "index"|awk '{print }'`
sleep $num
_secE=`ls -l /usr/local/mysql/var/$_relay_log|grep -v "index"|awk '{print }'`
_LOG=`expr $_secE - $_secB`
_LOGE=`echo "scale=2;$_LOG/$num"|bc -l`
echo $_LOGE
}
num=
if [ -z "$num" ]
then
num=1
replication
else
num=
replication
fi
|
|