fait fonctionner la sauvegarde mariadb
This commit is contained in:
parent
a199b9182d
commit
d19bfdebf9
|
@ -9,19 +9,19 @@ DESC="Exportation des bases MariaDB"
|
||||||
MYSQLSAVDIR=$SAVDIR/sql
|
MYSQLSAVDIR=$SAVDIR/sql
|
||||||
OPTION="--lock-tables"
|
OPTION="--lock-tables"
|
||||||
|
|
||||||
rm -f $MYSQLSAVDIR/*.sql
|
rm -f $MYSQLSAVDIR/*.sql || true
|
||||||
mkdir -p $MYSQLSAVDIR
|
mkdir -p $MYSQLSAVDIR
|
||||||
|
|
||||||
CMD="mysql --defaults-file=/etc/mysql/mariadbBackup.cnf -e 'show databases' | grep -v '^Database$'"
|
DATABASES=$(mysql --defaults-file=/etc/mysql/mariadbBackup.cnf -e 'show databases' | grep -v '^Database$')
|
||||||
DATABASES=$(CreoleRun "$CMD" mysql)
|
|
||||||
for databasename in $DATABASES; do
|
for databasename in $DATABASES; do
|
||||||
case "$databasename" in
|
case "$databasename" in
|
||||||
information_schema|performance_schema|bareos)
|
information_schema|performance_schema|bareos)
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
CMD="mysqldump --defaults-file=/etc/mysql/mariadbBackup.cnf --databases $databasename --flush-privileges --create-options -Q -c $OPTION 2>/dev/null"
|
mysqldump --defaults-file=/etc/mysql/mariadbBackup.cnf --databases $databasename --flush-privileges --create-options -Q -c $OPTION 2>/dev/null > $MYSQLSAVDIR/$databasename.sql
|
||||||
CreoleRun "$CMD" mysql > $MYSQLSAVDIR/$databasename.sql
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue