I would like to send an email message to my pager notifying me when a
process finishes. How can I detect when a process finishes? I'm running
AIX 4.2.1 using korn shell. Thanks. -Dean
Sent via Deja.com
http://www.deja.com/
Sent via Deja.com
http://www.deja.com/
Hi Dean,Quote:> I would like to send an email message to my pager notifying me when a
> process finishes. How can I detect when a process finishes? I'm
running
> AIX 4.2.1 using korn shell. Thanks. -Dean
> Sent via Deja.com
> http://www.deja.com/
A quick and Dirty script I use (Solaris 2.6) follows. I call the
process from a script and just keep checking every 5 secs if it is
still there.
#!/bin/ksh
. $HOME/myprocess 2>/dev/null &
PID=$!
#echo $PID
while sleep 5
do
ps -p$PID >/dev/null
if [ $? != 0 ]
then
echo "Call My Pager Here If I Had One"
exit 1
fi
done
Don't if this is any use to you?
/Dave
Sent via Deja.com
http://www.deja.com/
pageme "Process $pid exited"
On Solaris, you would use "pwait $pid", perhaps AIX has a similar
cheap mechanism.
Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
> I would like to send an email message to my pager notifying me when a
> process finishes. How can I detect when a process finishes? I'm running
> AIX 4.2.1 using korn shell. Thanks. -Dean
#!/bin/sh
process_you_want_to_run
echo It finished | mail yourself
What could be easier?
#!/bin/ksh
$HOME/myprocess 2>/dev/null
echo "Call My Pager with exit status: $?"
exit
> > Sent via Deja.com
> > http://www.deja.com/
> Hi Dean,
> A quick and Dirty script I use (Solaris 2.6) follows. I call the
> process from a script and just keep checking every 5 secs if it is
> still there.
> #!/bin/ksh
> . $HOME/myprocess 2>/dev/null &
> PID=$!
> #echo $PID
> while sleep 5
> do
> ps -p$PID >/dev/null
> if [ $? != 0 ]
> then
> echo "Call My Pager Here If I Had One"
> exit 1
> fi
> done
> Don't if this is any use to you?
> /Dave
> Sent via Deja.com
> http://www.deja.com/
1. system call starting next process before first process is finished.
Hello,
I have a c++ program which has infinite loop.
Inside the loop I have some code which gets the data file when it
arrives it starts a process using system call. When there are two
files available, it starts two processes with two files at one given
time, without waiting first to finish. It works fine but I want to
wait on the the system call. i.e I want the system to call to finish
first process and then it should continue and if there is second file
then it should start second process by using system call.
Please help me in fisxing this problem
Thanks in advance
Ravi Bhave
++++++++++++++++++++++++++++++++++++++++++++++++++++
for (;;)
{
if file exists in a direectory
{
system(program, filename);
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++
2. Matrox G400 TV-out no mouse cursor!?
3. How do I detect when Demon have finished sending me mail?
4. Sharing a tip/cu/mterm line???
5. detecting process death from unrelated process
7. Redirecting a process or detecting a process?
8. Always return the same ServerName??
9. Running Processes After Others Finish
10. Wait for process to finish
11. PID after process is finished
12. Q:background process finished ssignal?
13. Process finish notification