"test sys_refresh_ref_cron.sh"

This commit is contained in:
Doug Le Tough 2017-07-25 12:59:02 +02:00
parent 4532c10cb3
commit feafb53fb6

View File

@ -169,13 +169,12 @@ function refresh_cronjobs
fct_message ${MESSAGE} -color ${COLOR} fct_message ${MESSAGE} -color ${COLOR}
if [ ${#CRONJOB} -gt 0 ]; then if [ ${#CRONJOB} -gt 0 ]; then
fct_message "Checking database:" fct_message "Checking database:"
CRONJOB="$@" MINUTES=$(echo ${CRONJOB} | cut -d' ' -f1)
MINUTES=$(echo ${CRONJOB} | awk -F ' ' '{print $1}') HOURS=$(echo ${CRONJOB} | cut -d' ' -f2)
HOURS=$(echo ${CRONJOB} | awk -F ' ' '{print $2}') DAYS=$(echo ${CRONJOB} | cut -d' ' -f3)
DAYS=$(echo ${CRONJOB} | awk -F ' ' '{print $3}') MONTHS=$(echo ${CRONJOB} | cut -d' ' -f4)
MONTHS=$(echo ${CRONJOB} | awk -F ' ' '{print $4}') DAYOFWEEK=$(echo ${CRONJOB} | cut -d' ' -f5)
DAYOFWEEK=$(echo ${CRONJOB} | awk -F ' ' '{print $5}') COMMAND=$(echo ${CRONJOB} | cut -d' ' -f6-)
COMMAND=$(echo ${CRONJOB} | awk -F ' ' '{$1=$2=$3=$4=$5=""; print $0}')
REQUEST_ID_PARAMS="host='${VM}' and s_user='${TETALAB_USER}' and minutes='${MINUTES}' 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}'" 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 RESULT=$(psql -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "select ID from