Merge branch 'staging' into dist/eole/2.7.0/staging
This commit is contained in:
commit
bc5078ff9b
27
schedule/scripts/mariadb
Normal file
27
schedule/scripts/mariadb
Normal file
@ -0,0 +1,27 @@
|
||||
#!/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
|
@ -1,7 +0,0 @@
|
||||
# Configuration commune aux scripts schedule
|
||||
# Configuration de base modifiée pour copier dans le partage nfs plutôt que /home
|
||||
|
||||
SAVDIR=/mnt/sauvegardes/
|
||||
# pour que l'affichage de [ ok ] soit ok
|
||||
export TERM='dumb'
|
||||
umask 0077
|
@ -1,27 +0,0 @@
|
||||
#!/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
|
||||
mkdir -p $MYSQLSAVDIR
|
||||
|
||||
CMD="mysql --defaults-file=/etc/mysql/mariadbBackup.cnf -e 'show databases' | grep -v '^Database$'"
|
||||
DATABASES=$(CreoleRun "$CMD" mysql)
|
||||
for databasename in $DATABASES; do
|
||||
case "$databasename" in
|
||||
information_schema|performance_schema|bareos)
|
||||
continue
|
||||
;;
|
||||
*)
|
||||
CMD="mysqldump --defaults-file=/etc/mysql/mariadbBackup.cnf --databases $databasename --flush-privileges --create-options -Q -c $OPTION 2>/dev/null"
|
||||
CreoleRun "$CMD" mysql > $MYSQLSAVDIR/$databasename.sql
|
||||
;;
|
||||
esac
|
||||
done
|
Loading…
Reference in New Issue
Block a user