28 lines
697 B
Bash
28 lines
697 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
DESC="Exportation des bases MariaDB"
|
|
|
|
. /usr/share/eole/schedule/config.sh
|
|
|
|
MYSQLSAVDIR=$SAVDIR/sql
|
|
OPTION="--lock-tables"
|
|
|
|
rm -f $MYSQLSAVDIR/*.sql || true
|
|
mkdir -p $MYSQLSAVDIR
|
|
|
|
DATABASES=$(mysql --defaults-file=/etc/mysql/mariadbBackup.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/mariadbBackup.cnf --databases $databasename --flush-privileges --create-options -Q -c $OPTION 2>/dev/null > $MYSQLSAVDIR/$databasename.sql
|
|
;;
|
|
esac
|
|
done
|
|
|
|
exit 0
|