|
|
|
@ -181,7 +181,8 @@ function refresh_cronjobs
@@ -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" |
|
|
|
|