source: pvrrd/checkup-epics2rrd.csh @ 208

Last change on this file since 208 was 208, checked in by jemian, 13 years ago

ps is different on solaris -- epics2rrd.csh needs some environemtn variables

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Date Author Revision Url Id
File size: 1.5 KB
Line 
1#!/bin/tcsh
2#
3# description: check that epics2rrd (EPICS->RRD update) script is running
4#
5# processname: checkup-epics2rrd
6
7########### SVN repository information ###################
8# $Date: 2010-08-26 21:07:09 +0000 (Thu, 26 Aug 2010) $
9# $Author: jemian $
10# $Revision: 208 $
11# $HeadURL$
12# $Id: checkup-epics2rrd.csh 208 2010-08-26 21:07:09Z jemian $
13########### SVN repository information ###################
14
15setenv RRD_LOGS_BASE_DIR /home/joule/WEB33/www/rrd
16setenv SCRIPT  ${RRD_LOGS_BASE_DIR}/epics2rrd.csh
17setenv LOGFILE ${RRD_LOGS_BASE_DIR}/epics2rrd.log
18setenv PIDFILE ${RRD_LOGS_BASE_DIR}/epics2rrd.pid
19
20#echo "#===================="    >>& ${LOGFILE}
21#echo "#`date`"          >>& ${LOGFILE}
22set pid = `/bin/cat ${PIDFILE}`
23#set test = `/bin/ps -p ${pid} --no-header -o pid`
24set test = `/bin/ps -p ${pid} -o pid | sed 's+PID++'`
25
26##/bin/echo "`env`"      >>& ${LOGFILE}
27#/bin/echo "pid = <$pid>"        >>& ${LOGFILE}
28#/bin/echo "test = <$test>"      >>& ${LOGFILE}
29
30if (${pid} != ${test}) then
31  echo "#===================="   >>& ${LOGFILE}
32  echo "# `/bin/date` could not identify running process ${pid}, restarting" >>& ${LOGFILE}
33  #echo `${SCRIPT} stop` >& /dev/null
34  #echo `${SCRIPT} start` >& /dev/null
35 
36  echo `${SCRIPT} stop`  >>& ${LOGFILE}
37  echo `${SCRIPT} start` >>& ${LOGFILE}
38#else
39#  echo "${pid} and ${test} must be equal" >>& ${LOGFILE}
40endif
41
42#echo "end of checkup script"  >>& ${LOGFILE}
43#  log EPICS PVs into RRD for WWW browsing of logs
44#  * * * * * /home/joule/WEB33/www/rrd/htmlCreate.py >& /home/joule/WEB33/www/rrd/htmlCreate.log
45#  1,6,11,16,21,26,31,36,41,46,51,56 * * * * /home/joule/WEB33/www/rrd/checkup-epics2rrd.csh 2>&1 /dev/null
Note: See TracBrowser for help on using the repository browser.