Re: how to send email once process finishes
- From: Dances With Crows <danSPANceswithTRAPcrows@xxxxxxxxx>
- Date: Sun, 30 Sep 2007 19:29:55 GMT
bahoo staggered into the Black Sun and said:
Hi, I'd like to send myself an email once a particular process ends.
I know the PID, and it usually runs for several hours, so I'd like to
know when it finishes. Is it possible to write a script to do that?
# PID=whatever pid you want to watch
while [ -e /proc/$PID ] ; do
sleep 30 # change to 15 or 60 or whatever
done
echo "Process done" | mail -s "process finished" someone@xxxxxxxxxxx
# there are multiple ways to do this; this is one way. This doesn't do
# any error handling or check the process's return status. It might
# fail miserably if the machine's being used by tons of people. HTH,
--
One suspects that with one side demanding DRM and the other side
demanding it not get in the way of enjoying the purchase, friable DRM is
the technical solution that makes everyone happy. --AdB, in ASR
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
.
- References:
- how to send email once process finishes
- From: bahoo
- how to send email once process finishes
- Prev by Date: WTS: Suse Linux Enterprise Server 10 and Suse Linux Enterprise Server 9
- Next by Date: Re: how to send email once process finishes
- Previous by thread: how to send email once process finishes
- Next by thread: Re: how to send email once process finishes
- Index(es):
Relevant Pages
|