Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- rm -f /tmp/dbcompareresult
- OUTPUT=`docker run --rm --link your_mysql_container:mysql -v /tmp/:/tmp/ macropage/mysql-utilities bash -c 'mysqldbcompare --skip-row-count --skip-data-check --difftype=sql --compact --server1=user:pwd@mysql:3306 --server2=user:pwd@slave:3306 db1:db2 |tee /tmp/dbcompareresult; exit ${PIPESTATUS[0]}'`
- if [ ! -f /tmp/dbcompareresult ]; then
- echo "CRITICAL COMMAND DID NOT RUN!";
- exit 2
- fi
- if [ $? -ne 0 ]; then
- LASTLINE=`tail -1 /tmp/dbcompareresult`
- echo "CRITICAL - $LASTLINE"
- exit 2
- else
- echo "OK $LASTLINE - Slave Schema equal to Master"
- exit 0
- fi
Add Comment
Please, Sign In to add comment