From b456a24eaf5cb20e9be9a80cad20d018371d0817 Mon Sep 17 00:00:00 2001 From: Doug Le Tough Date: Tue, 25 Jul 2017 13:19:24 +0200 Subject: [PATCH] "test sys_refresh_ref_cron.sh" --- bin/sys_refresh_ref_cron.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/sys_refresh_ref_cron.sh b/bin/sys_refresh_ref_cron.sh index e65d50a..7349a2c 100755 --- a/bin/sys_refresh_ref_cron.sh +++ b/bin/sys_refresh_ref_cron.sh @@ -152,7 +152,7 @@ function clean_table if [ "${force}" == "true" ]; then fct_message "Option -force activée: Suppression des données dans la table." -color orange SQL="delete from ref_cron where id > 0;" - psql -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "${SQL}" + psql -q -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "${SQL}" fi } @@ -186,13 +186,13 @@ function refresh_cronjobs COMMAND=$(echo ${CRONJOB} | cut -d' ' -f6-) REQUEST_ID_PARAMS="host='${VM}' and s_user='${TETALAB_USER}' and minutes='${MINUTES}' and hours='${HOURS}' and days='${DAYS}' and months='${MONTHS}' and daysofweek='${DAYSOFWEEK}' and command='${COMMAND}'" - RESULT=$(psql -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "select ID from + RESULT=$(psql -q -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "select ID from ref_cron where ${REQUEST_ID_PARAMS};") if [ ${#RESULT} -eq 0 ]; then fct_message " -> Cronjob not in database, inserting..." REQUEST_INSERT_PARAMS="'${VM}', '${TETALAB_USER}', '${MINUTES}', '${HOURS}', '${DAYS}', '${MONTHS}', '${DAYSOFWEEK}', '${COMMAND}'" - psql -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "insert into ref_cron + psql -q -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "insert into ref_cron (\"host\", \"s_user\", \"minutes\", \"hours\", \"days\", \"months\", \"daysofweek\", \"command\") values (${REQUEST_INSERT_PARAMS});" else