"test sys_refresh_ref_cron.sh"
This commit is contained in:
parent
6bbf7aec53
commit
8f743c5e28
@ -158,16 +158,13 @@ function refresh_cronjobs
|
|||||||
fct_message " * ${TETALAB_USER}" -color orange
|
fct_message " * ${TETALAB_USER}" -color orange
|
||||||
IFS_BAK=${IFS}
|
IFS_BAK=${IFS}
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
CRONJOBS=$(ssh ${VM} "sudo crontab -u ${TETALAB_USER} -l 2>&1 | grep -v '^\#' | grep -v '^$' | grep -vP '^ +$'")
|
CRONJOBS=$(ssh ${VM} "sudo crontab -u ${TETALAB_USER} -l 2>/dev/null | grep -v '^\#' | grep -v '^$' | grep -vP '^ +$'")
|
||||||
for CRONJOB in ${CRONJOBS}
|
for CRONJOB in ${CRONJOBS}
|
||||||
do
|
do
|
||||||
COLOR="blanc"
|
COLOR="blanc"
|
||||||
MESSAGE=" - ${CRONJOB}"
|
MESSAGE=" - ${CRONJOB}"
|
||||||
if [ $(echo "${CRONJOB}" | grep "run-parts" | wc -l) -eq 1 ]; then
|
if [ $(echo "${CRONJOB}" | grep "run-parts" | wc -l) -eq 1 ]; then
|
||||||
COLOR="vert"
|
COLOR="vert"
|
||||||
elif [ $(echo "${CRONJOB}" | grep "no crontab for" | wc -l) -eq 1 ]; then
|
|
||||||
COLOR="cyan"
|
|
||||||
CRONJOB=""
|
|
||||||
fi
|
fi
|
||||||
fct_message ${MESSAGE} -color ${COLOR}
|
fct_message ${MESSAGE} -color ${COLOR}
|
||||||
if [ ${#CRONJOB} -gt 0 ]; then
|
if [ ${#CRONJOB} -gt 0 ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user