Compare commits
No commits in common. "33a7cf66c6b837040eda6a1f72e4ac6ca3bde279" and "144375c7618a3f3a5ad83798352be6a19b7ebb38" have entirely different histories.
33a7cf66c6
...
144375c761
|
@ -9,11 +9,19 @@ DESC="Exportation des bases MariaDB"
|
|||
MYSQLSAVDIR=$SAVDIR/sql
|
||||
OPTION="--lock-tables"
|
||||
|
||||
if [[ -d ${MYSQLSAVDIR} ]]
|
||||
then
|
||||
rm -rf ${MYSQLSAVDIR}
|
||||
mkdir -p ${MYSQLSAVDIR}
|
||||
fi
|
||||
rm -f $MYSQLSAVDIR/*.sql || true
|
||||
mkdir -p $MYSQLSAVDIR
|
||||
|
||||
mariabackup --defaults-file=/etc/mysql/debian.cnf --backup --target-dir=$MYSQLSAVDIR
|
||||
exit $?
|
||||
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
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue