Last active
May 19, 2017 13:06
-
-
Save Bouhnosaure/a4910c3c802c9e2823c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#date du jour | |
DATE=`date +%y_%m_%d` | |
#liste des dossier | |
LISTEBDD=$( echo 'show databases' | mysql -uroot -pPWD ) | |
for SQL in $LISTEBDD | |
do | |
if [ $SQL != "information_schema" ] && [ $SQL != "mysql" ] && [ $SQL != "cond_instances" ] && [ $SQL != "Database" ]; then | |
#echo $SQL | |
mysqldump -uroot -pPWD $SQL --skip-lock-tables | gzip > /home/user/sql/$SQL"_mysql_"$DATE.sql.gz | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment