Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
04a17d6e
Commit
04a17d6e
authored
Oct 23, 2014
by
Dan Reading
Browse files
stuff for cron job
parent
d9996bc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientside/tmcc/common/checknode/gen_sql
View file @
04a17d6e
...
...
@@ -486,13 +486,16 @@ setdirstructure() {
genreport_main() {
reporting=1
[[ -z "
${
RUNNING_FROM_CRON
-
}
" ]] && declare RUNNING_FROM_CRON="
NO
"
if [ "
${
RUNNING_FROM_CRON
}
" != "
NO
" ] ; then
[[ -z "
${
CHECKNODE_CRONJOB
-
}
" ]] && declare CHECKNODE_CRONJOB="
NO
"
[[ -z "
${
CHECKNODE_MTA
-
}
" ]] && declare CHECKNODE_MTA="
sendmail
-t
"
[[ -z "
${
CHECKNODE_MAILTO
-
}
" ]] && declare CHECKNODE_MAILTO=""
if [ "
${
CHECKNODE_CRONJOB
}
" != "
NO
" ] ; then
# if MAILTO is empty then switch to cat-ing the info, cron can do with it what is wants
# i.e. use the standard cron MAILTO var
[[ -z "
${
CHECKNODE_MAILTO
}
" ]] && CHECKNODE_MTA="
cat
"
echo "
Subject
:
CheckNode report for
$(
hostname
)
" > /tmp/Report_CheckNode
echo "
From
:
CheckNode
" >> /tmp/Report_CheckNode
echo "
To
:
dreading@flux.utah.edu
" >> /tmp/Report_CheckNode
echo "
To
:
${
CHECKNODE_MAILTO
}
" >> /tmp/Report_CheckNode
else
echo "" > /tmp/Report_CheckNode
fi
...
...
@@ -522,11 +525,12 @@ genreport_main() {
rm -f /tmp/genreport /tmp/driftreport
done
if [ "
${
RUNNING_FROM
_CRON
}
" != "
NO
" ] ; then
cat /tmp/Report_CheckNode |
sendmail -t
if [ "
${
CHECKNODE
_CRON
JOB
}
" != "
NO
" ] ; then
cat /tmp/Report_CheckNode |
${
CHECKNODE_MTA
}
else
cat /tmp/Report_CheckNode
fi
rm -f /tmp/Report_CheckNode
}
# start here
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment