#!/bin/bash

rm -rf /opt/configs/mysql/sql*.gz
filename='sql-'`date +%Y%m%d%H%M`'.sql.gz'
mysql -e "show databases;" -uroot | grep -Ev "Database|information_schema|performance_schema" | xargs mysqldump --skip-lock-tables -uroot --databases | gzip > $filename
mv sql-*.gz /opt/configs/mysql/

