--- /dev/null
+#!/usr/bin/python
+
+import time
+import MySQLdb as sql
+con = sql.connect('localhost','root','',unix_socket='/srv/mysql/mysql.sock')
+cur = con.cursor(sql.cursors.DictCursor)
+
+while 1:
+ cur.execute('SHOW SLAVE STATUS')
+ r = cur.fetchone()
+ if r['Slave_IO_Running'] == 'Yes' and r['Seconds_Behind_Master'] is None:
+ print 'Skipping next due to:'
+ print r['Last_Error']
+ cur.execute('SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1')
+ cur.execute('START SLAVE')
+ else:
+ time.sleep(1)