2018-06-22 16:33:59 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-02-15 11:04:05 +01:00
|
|
|
DESC="Exportation des bases MariaDB"
|
2018-06-22 16:33:59 +02:00
|
|
|
|
|
|
|
. /usr/share/eole/schedule/config.sh
|
|
|
|
|
|
|
|
MYSQLSAVDIR=$SAVDIR/sql
|
|
|
|
OPTION="--lock-tables"
|
|
|
|
|
2019-04-18 17:00:07 +02:00
|
|
|
rm -f $MYSQLSAVDIR/*.sql || true
|
2018-06-22 16:33:59 +02:00
|
|
|
mkdir -p $MYSQLSAVDIR
|
|
|
|
|
2019-05-20 10:25:25 +02:00
|
|
|
DATABASES=$(mysql --defaults-file=/etc/mysql/debian.cnf -e 'show databases' | grep -v '^Database$')
|
2018-06-22 16:33:59 +02:00
|
|
|
for databasename in $DATABASES; do
|
|
|
|
case "$databasename" in
|
|
|
|
information_schema|performance_schema|bareos)
|
|
|
|
continue
|
|
|
|
;;
|
|
|
|
*)
|
2019-05-20 10:25:25 +02:00
|
|
|
mysqldump --defaults-file=/etc/mysql/debian.cnf --databases $databasename --flush-privileges --create-options -Q -c $OPTION 2>/dev/null > $MYSQLSAVDIR/$databasename.sql
|
2018-06-22 16:33:59 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2019-04-18 17:00:07 +02:00
|
|
|
|
|
|
|
exit 0
|