[root@azure_dbm1_s1 scripts]# more slave_1062_stop.sh
#/bin/bash
slave_num=`mysql -e "show slave status\G" |grep Last_SQL_Errno |awk {'print $2}'`
echo $slave_num
while [[ $slave_num = "1062" ]];
do
mysql -e "stop slave; set global sql_slave_skip_counter=1; start slave;"
slave_num=`mysql -e "show slave status\G" |grep Last_SQL_Errno |awk {'print $2}'`
done
[root@azure_dbm1_s1 scripts]#