Browse Source

"test sys_refresh_ref_cron.sh"

master
Doug Le Tough 5 years ago
parent
commit
feafb53fb6
  1. 13
      bin/sys_refresh_ref_cron.sh

13
bin/sys_refresh_ref_cron.sh

@ -169,13 +169,12 @@ function refresh_cronjobs @@ -169,13 +169,12 @@ function refresh_cronjobs
fct_message ${MESSAGE} -color ${COLOR}
if [ ${#CRONJOB} -gt 0 ]; then
fct_message "Checking database:"
CRONJOB="$@"
MINUTES=$(echo ${CRONJOB} | awk -F ' ' '{print $1}')
HOURS=$(echo ${CRONJOB} | awk -F ' ' '{print $2}')
DAYS=$(echo ${CRONJOB} | awk -F ' ' '{print $3}')
MONTHS=$(echo ${CRONJOB} | awk -F ' ' '{print $4}')
DAYOFWEEK=$(echo ${CRONJOB} | awk -F ' ' '{print $5}')
COMMAND=$(echo ${CRONJOB} | awk -F ' ' '{$1=$2=$3=$4=$5=""; print $0}')
MINUTES=$(echo ${CRONJOB} | cut -d' ' -f1)
HOURS=$(echo ${CRONJOB} | cut -d' ' -f2)
DAYS=$(echo ${CRONJOB} | cut -d' ' -f3)
MONTHS=$(echo ${CRONJOB} | cut -d' ' -f4)
DAYOFWEEK=$(echo ${CRONJOB} | cut -d' ' -f5)
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

Loading…
Cancel
Save