eole-mariadb/schedule/scripts/mariadb

28 lines
671 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
set -e
DESC="Exportation des bases MariaDB"
. /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
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$')
for databasename in $DATABASES; do
case "$databasename" in
information_schema|performance_schema|bareos)
continue
;;
*)
mysqldump --defaults-file=/etc/mysql/debian.cnf --databases $databasename --flush-privileges --create-options -Q -c $OPTION > $MYSQLSAVDIR/$databasename.sql
;;
esac
done
2019-04-18 17:00:07 +02:00
exit 0