DAC Restart Script

Hi,

Just thought I would share the script I wrote to restart your DAC server in the event of a crash, this can be helpful during the night as there is no need for a manual restart.

I used a cron job to check to see if the process is running every 5min.


#!/bin/ksh

#########################################################
 # NAME:email_dac_restart.sh #
 # AUTHOR:  #
 # DESC: Makes sure dac is running and restarts if not #
 # VERSION: 18/1/13 #
 # CHANGE LOG: #
 #########################################################

. ~/.profile

if ps -ef | grep '/usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -server -Xmn500m -Xms2048m -Xmx204'
 then
 echo 'do nothing'
 ## tail -1 $DAC_HOME/nohup.out | mailx -s 'DAC Running TST1 ' [email protected]
 else
 cd $DAC_HOME
 nohup $DAC_HOME/startserver.sh &
 tail -200 $DAC_HOME/nohup.out | mailx -s 'DAC Restarted  ' [email protected]
 fi

exit
 EOF

Any improvements or comments are welcome


Posted

in

by

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.