Compare commits

..

No commits in common. "33a7cf66c6b837040eda6a1f72e4ac6ca3bde279" and "144375c7618a3f3a5ad83798352be6a19b7ebb38" have entirely different histories.

1 changed files with 15 additions and 7 deletions

View File

@ -9,11 +9,19 @@ DESC="Exportation des bases MariaDB"
MYSQLSAVDIR=$SAVDIR/sql MYSQLSAVDIR=$SAVDIR/sql
OPTION="--lock-tables" OPTION="--lock-tables"
if [[ -d ${MYSQLSAVDIR} ]] rm -f $MYSQLSAVDIR/*.sql || true
then mkdir -p $MYSQLSAVDIR
rm -rf ${MYSQLSAVDIR}
mkdir -p ${MYSQLSAVDIR}
fi
mariabackup --defaults-file=/etc/mysql/debian.cnf --backup --target-dir=$MYSQLSAVDIR DATABASES=$(mysql --defaults-file=/etc/mysql/debian.cnf -e 'show databases' | grep -v '^Database$')
exit $? 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
exit 0