"test sys_refresh_ref_cron.sh"
This commit is contained in:
parent
725f042087
commit
12db87115f
@ -185,13 +185,13 @@ function refresh_cronjobs
|
|||||||
DAYOFWEEK=$(echo ${CRONJOB} | cut -d' ' -f5)
|
DAYOFWEEK=$(echo ${CRONJOB} | cut -d' ' -f5)
|
||||||
COMMAND=$(echo ${CRONJOB} | cut -d' ' -f6-)
|
COMMAND=$(echo ${CRONJOB} | cut -d' ' -f6-)
|
||||||
REQUEST_ID_PARAMS="host='${VM}' and s_user='${TETALAB_USER}' and minutes='${MINUTES}' and hours='${HOURS}'
|
REQUEST_ID_PARAMS="host='${VM}' and s_user='${TETALAB_USER}' and minutes='${MINUTES}' and hours='${HOURS}'
|
||||||
and days='${DAYS}' and months='${MONTHS}' and daysofweek='${DAYSOFWEEKS}' and command='${COMMAND}'"
|
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 -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "select ID from
|
||||||
ref_cron where ${REQUEST_ID_PARAMS};")
|
ref_cron where ${REQUEST_ID_PARAMS};")
|
||||||
if [ ${#RESULT} -eq 0 ]; then
|
if [ ${#RESULT} -eq 0 ]; then
|
||||||
fct_message " -> Cronjob not in database, inserting..."
|
fct_message " -> Cronjob not in database, inserting..."
|
||||||
REQUEST_INSERT_PARAMS="'${VM}', '${TETALAB_USER}', '${MINUTES}',
|
REQUEST_INSERT_PARAMS="'${VM}', '${TETALAB_USER}', '${MINUTES}',
|
||||||
'${HOURS}', '${DAYS}', '${MONTHS}', '${DAYSOFWEEKS}', '${COMMAND}'"
|
'${HOURS}', '${DAYS}', '${MONTHS}', '${DAYSOFWEEK}', '${COMMAND}'"
|
||||||
psql -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "insert into ref_cron
|
psql -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "insert into ref_cron
|
||||||
(\"host\", \"s_user\", \"minutes\", \"hours\", \"days\", \"months\", \"daysofweek\", \"command\")
|
(\"host\", \"s_user\", \"minutes\", \"hours\", \"days\", \"months\", \"daysofweek\", \"command\")
|
||||||
values (${REQUEST_INSERT_PARAMS});"
|
values (${REQUEST_INSERT_PARAMS});"
|
||||||
|
Loading…
Reference in New Issue
Block a user