From 0327098015660f61a631fe6bb4d2c70dbabd9766 Mon Sep 17 00:00:00 2001 From: Teddy Cornaut Date: Wed, 13 Mar 2019 15:19:02 +0100 Subject: [PATCH 1/4] =?UTF-8?q?Correction=20boucle=20de=20d=C3=A9finitions?= =?UTF-8?q?=20des=20droits=20utilisateurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- postservice/25-bdd-admin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postservice/25-bdd-admin b/postservice/25-bdd-admin index 2d6df4f..d830941 100755 --- a/postservice/25-bdd-admin +++ b/postservice/25-bdd-admin @@ -28,6 +28,8 @@ then previousUsers=($(awk -F ':' '{print $1}' ${readerfile} )) + index=0 + for user in ${accounts[@]} do PASS=$(awk -F ':' "/${user}:/ {print \$2}" ${readerfile}) @@ -54,7 +56,6 @@ then done fi - index=0 for hst in ${hostsList[@]} do SQL="DROP USER IF EXISTS '${user}'@'${hst}';" @@ -86,4 +87,3 @@ then fi exit 0 - From d87c9ee307cf6e8d45bfd60988ca0a9951085731 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 18 Apr 2019 14:52:17 +0200 Subject: [PATCH 2/4] ajout des extras dans le paquet --- {schedule_config => schedule/config}/config.sh | 0 {schedule_extra => schedule/extra}/01_mariadb.xml | 0 {schedule_scripts => schedule/scripts}/mariadb | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {schedule_config => schedule/config}/config.sh (100%) rename {schedule_extra => schedule/extra}/01_mariadb.xml (100%) rename {schedule_scripts => schedule/scripts}/mariadb (100%) diff --git a/schedule_config/config.sh b/schedule/config/config.sh similarity index 100% rename from schedule_config/config.sh rename to schedule/config/config.sh diff --git a/schedule_extra/01_mariadb.xml b/schedule/extra/01_mariadb.xml similarity index 100% rename from schedule_extra/01_mariadb.xml rename to schedule/extra/01_mariadb.xml diff --git a/schedule_scripts/mariadb b/schedule/scripts/mariadb similarity index 100% rename from schedule_scripts/mariadb rename to schedule/scripts/mariadb From a199b9182d5863668f02858f7febc4a68cb6c5c9 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 18 Apr 2019 14:58:05 +0200 Subject: [PATCH 3/4] sauvegarde plutot dans /home/backup --- schedule/config/config.sh | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 schedule/config/config.sh diff --git a/schedule/config/config.sh b/schedule/config/config.sh deleted file mode 100644 index 2562ef3..0000000 --- a/schedule/config/config.sh +++ /dev/null @@ -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 From d19bfdebf9eeb5466441eb85c405fc157301bb89 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 18 Apr 2019 17:00:07 +0200 Subject: [PATCH 4/4] fait fonctionner la sauvegarde mariadb --- schedule/scripts/mariadb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/schedule/scripts/mariadb b/schedule/scripts/mariadb index 0dda3ea..161103a 100644 --- a/schedule/scripts/mariadb +++ b/schedule/scripts/mariadb @@ -9,19 +9,19 @@ DESC="Exportation des bases MariaDB" MYSQLSAVDIR=$SAVDIR/sql OPTION="--lock-tables" -rm -f $MYSQLSAVDIR/*.sql +rm -f $MYSQLSAVDIR/*.sql || true mkdir -p $MYSQLSAVDIR -CMD="mysql --defaults-file=/etc/mysql/mariadbBackup.cnf -e 'show databases' | grep -v '^Database$'" -DATABASES=$(CreoleRun "$CMD" mysql) +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 ;; *) - 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 + 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