Merge branch 'master' into dist/eole/2.6.2/master

This commit is contained in:
Philippe Caseiro 2018-09-03 14:02:59 +02:00
commit b4cccc5e12
6 changed files with 66 additions and 1 deletions

View File

@ -30,6 +30,9 @@
<variable name="dbEnable" type='oui/non' description='Activer le serveur de base de données MariaDB'>
<value>non</value>
</variable>
<variable name="dbEnableBackup" type='oui/non' description='Activer la sauvegarde sur le serveur de base de données MariaDB'>
<value>non</value>
</variable>
</family>
<family name="Database">
<variable name='dbEnableCluster' type='oui/non' description="Activer la mise en grappe MariaDB Galera ?">
@ -64,6 +67,9 @@
<variable name='dbInnoDBLogFileSize' type='number' description="Taille des fichiers de transaction InnoDB">
<value>6</value>
</variable>
<variable name='dbInnoDBLockWaitTimeout' type='number' description="Nombre de millisecondes d'attente avant de fermer la connection en lock (innodb_lock_wait_timeout)">
<value>120</value>
</variable>
<variable name="dbMaxConnections" type="number" description="Nombre de connection maximum pour le serveur de bases de données (max_connections)">
<value>100</value>
</variable>

View File

@ -1 +1,3 @@
creolefuncs_DATA_DIR := $(DESTDIR)/usr/share/creole/funcs
schedule_extra_DATA_DIR := $(DESTDIR)/usr/share/eole/creole/extra/schedule/
schedule_config_DATA_DIR := $(DESTDIR)/usr/share/eole/schedule/

View File

@ -0,0 +1,7 @@
# 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

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<creole>
<variables>
<family name="mysql" description="Exportation des bases de données MySQL">
<variable name="description" type="string" hidden="True"><value>Exportation des bases MySQL</value></variable>
<variable name="day" type="schedule" description="Périodicité d'exécution"><value>daily</value></variable>
<variable name="mode" type="schedulemod" hidden="True"><value>pre</value></variable>
</family>
</variables>
<constraints>
<fill name='calc_multi_condition' target='schedule.mysql.day'>
<param>non</param>
<param type='eole' name='condition_1'>dbEnableBackup</param>
<param name='match'>none</param>
<param name='mismatch'>daily</param>
</fill>
</constraints>
</creole>

27
schedule_scripts/mysql Normal file
View File

@ -0,0 +1,27 @@
#!/bin/bash
set -e
DESC="Exportation des bases MySQL"
. /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/mariadb.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/mariadb.cnf --databases $databasename --flush-privileges --create-options -Q -c $OPTION 2>/dev/null"
CreoleRun "$CMD" mysql > $MYSQLSAVDIR/$databasename.sql
;;
esac
done

View File

@ -5,6 +5,7 @@ skip-name-resolve
innodb_buffer_pool_size=%%getMemoryPercentage(%%getVar('dbInnoDBBufferPoolPercentage', 10))
innodb_log_buffer_size=%%{dbInnoDBLogBufferSize}M
innodb_log_file_size=%%{dbInnoDBLogFileSize}M
innodb_lock_wait_timeout=%%{dbInnoDBLockWaitTimeout}
max_connections=%%dbMaxConnections
thread_cache_size=%%dbThreadCacheSize
@ -14,6 +15,9 @@ query_cache_type = 1
query_cache_limit = %%getVar('dbQueryCacheLimit')
query_cache_min_res_unit = %%getVar('dbQueryCacheMinRestUnit')
query_cache_size = %%getVar('dbQueryCacheSize')
%else
query_cache_type = 0
query_cache_size = 0
%end if
tmp_table_size = %%dbTmpTableSize