Link to home
Start Free TrialLog in
Avatar of aixtutorial
aixtutorialFlag for United States of America

asked on

This is in AIX5.3..I need a script

This is in AIX5.3..I need a scriptthis is the path /siebel/bin/
in this path there are core file generated and when ever there is a core generated the core file under /siebel/bin gets appended with the core details,,,What i needis when this file gets appended with the new core info..Please send out an email to my e-mail address say aixtutorial@gmail.com
ASKER CERTIFIED SOLUTION
Avatar of liddler
liddler
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of woolmilkporc
Hi,

if I understand you right there is kind of a protocol file under /siebel/bin where ABEND details are recorded,
and you want to receive these detail information whenever an ABEND occurs (i.e. the protocol file grows).

OK, let's call this protocol file /siebel/bin/cores.

Now we can do something similar to liddler's approach:

#!/bin/ksh
wc -l < /siebel/bin/cores > /tmp/siebel_corecount
while true
do
 sleep 60
 CDIFF=$(($(wc -l < /siebel/bin/cores)-$(cat /tmp/siebel_corecount)))
 if [ $CDIFF -gt 0 ]
  then
   tail -$CDIFF /siebel/bin/cores | mailx -s "New core  file(s)" aixtutorial@gmail.com
   wc -l < /siebel/bin/cores > /tmp/siebel_corecount
 fi
done

run this script (I'll call it corewatch.sh) in the background this way:

nohup /path/to/corewatch.sh &

With some minor modifications we could also run the script from cron. Please let me know if this is desired.

wmp