From 7452567379b12ca961748c72c90d26de3b24c334 Mon Sep 17 00:00:00 2001 From: Doug Le Tough Date: Tue, 25 Jul 2017 12:36:21 +0200 Subject: [PATCH] "test sys_refresh_ref_cron.sh" --- bin/sys_refresh_ref_cron.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/sys_refresh_ref_cron.sh b/bin/sys_refresh_ref_cron.sh index 06d51d9..66324d6 100755 --- a/bin/sys_refresh_ref_cron.sh +++ b/bin/sys_refresh_ref_cron.sh @@ -178,12 +178,15 @@ 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 daysofweek='${DAYSOFWEEKS}' and command='${COMMAND}'" - RESULT=$(psql -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "select ID from ref_cron where ${REQUEST_ID_PARAMS};") + RESULT=$(psql -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}', '${DAYSOFWEEKS}', '${COMMAND}'" - psql -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "insert into ref_cron values (${REQUEST_INSERT_PARAMS});" + psql -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "insert into ref_cron + ('host', 's_user', 'minutes', 'hours', 'days', 'daysofweek', 'command') + values (${REQUEST_INSERT_PARAMS});" else fct_message "Cronjob already in database" fi