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
aixtutorialAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

liddlerCommented:
create a flag file
wait
test for a newer file in siebel directroy
if so email and reset flag

something like:

#/bin/bash
touch /tmp/flag
while true
do
sleep 60
if [ -f $(find /siebel/bin -newer /tmp/flag) ]
then
mail -s "new core file" aixtutorial@gmail.com
touch /tmp/flag
fi
done
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
woolmilkporcCommented:
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




0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.