[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

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

Posted on 2010-03-30
2
Medium Priority
?
366 Views
Last Modified: 2013-12-27
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
0
Comment
Question by:aixtutorial
2 Comments
 
LVL 18

Accepted Solution

by:
liddler earned 1000 total points
ID: 29178857
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
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 29486179
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

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month7 days, 13 hours left to enroll

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question