forked from qiime/qiime_web_app
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpoller_monitor.sh
27 lines (25 loc) · 957 Bytes
/
poller_monitor.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# This is a cron job for checking that qiime-poller is running
if [ -f /tmp/qiime-webapp-poller.pid ]
then
# get pid and verify it is running
pid=`cat /tmp/qiime-webapp-poller.pid`
jobinfo=`ps -f -p $pid | grep $pid`
# check that job is running
if [ "$jobinfo" == "" ]
then
if [ -f /tmp/qiime-webapp-poller.stderr ]
then
tail -n 100 /tmp/qiime-webapp-poller.stderr | mail -s "QIIME poller not running" [email protected]
else
echo "qiime-poller output files missing from /tmp/" | mail -s "QIIME poller not running" [email protected]
fi
fi
else
if [ -f /tmp/qiime-webapp-poller.stderr ]
then
tail -n 100 /tmp/qiime-webapp-poller.stderr | mail -s "QIIME poller not running" [email protected]
else
echo "qiime-poller output files missing from /tmp/" | mail -s "QIIME poller not running" [email protected]
fi
fi