]> andersk Git - sql.git/blame - sbin/slave_skip
backups: keep less monthlys
[sql.git] / sbin / slave_skip
CommitLineData
1cc0573f
JP
1#!/usr/bin/python
2
3import time
4import MySQLdb as sql
5con = sql.connect('localhost','root','',unix_socket='/srv/mysql/mysql.sock')
6cur = con.cursor(sql.cursors.DictCursor)
7
8while 1:
9 cur.execute('SHOW SLAVE STATUS')
10 r = cur.fetchone()
11 if r['Slave_IO_Running'] == 'Yes' and r['Seconds_Behind_Master'] is None:
12 print 'Skipping next due to:'
13 print r['Last_Error']
14 cur.execute('SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1')
15 cur.execute('START SLAVE')
16 else:
17 time.sleep(1)
This page took 0.160143 seconds and 5 git commands to generate.