"test sys_refresh_ref_cron.sh"

This commit is contained in:
Doug Le Tough 2017-07-25 12:29:42 +02:00
parent 4db7d19773
commit 0a85975992
1 changed files with 2 additions and 1 deletions

View File

@ -181,7 +181,8 @@ function refresh_cronjobs
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=$(echo ${REQUEST_ID_PARAMS} | sed -s 's/and/,/g')
REQUEST_INSERT_PARAMS="host='${VM}', s_user='${TETALAB_USER}', minutes='${MINUTES}',
hours='${HOURS}', days='${DAYS}', daysofweek='${DAYSOFWEEKS}', command='${COMMAND}'"
psql -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "insert into ref_cron values (${REQUEST_INSERT_PARAMS});"
else
fct_message "Cronjob already in database"