Compare commits
3 Commits
144375c761
...
33a7cf66c6
Author | SHA1 | Date |
---|---|---|
Philippe Caseiro | 33a7cf66c6 | |
Philippe Caseiro | 52eadb6bf1 | |
Emmanuel Garette | 44629b4587 |
|
@ -9,19 +9,11 @@ DESC="Exportation des bases MariaDB"
|
||||||
MYSQLSAVDIR=$SAVDIR/sql
|
MYSQLSAVDIR=$SAVDIR/sql
|
||||||
OPTION="--lock-tables"
|
OPTION="--lock-tables"
|
||||||
|
|
||||||
rm -f $MYSQLSAVDIR/*.sql || true
|
if [[ -d ${MYSQLSAVDIR} ]]
|
||||||
mkdir -p $MYSQLSAVDIR
|
then
|
||||||
|
rm -rf ${MYSQLSAVDIR}
|
||||||
|
mkdir -p ${MYSQLSAVDIR}
|
||||||
|
fi
|
||||||
|
|
||||||
DATABASES=$(mysql --defaults-file=/etc/mysql/debian.cnf -e 'show databases' | grep -v '^Database$')
|
mariabackup --defaults-file=/etc/mysql/debian.cnf --backup --target-dir=$MYSQLSAVDIR
|
||||||
for databasename in $DATABASES; do
|
exit $?
|
||||||
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
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
Loading…
Reference in New Issue