Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 07-20-2010, 11:09 AM   #1
LQ Newbie
Registered: Jul 2010
Posts: 1

Rep: Reputation: 0
running process that sends email when returns 0

hi all,

I need a litle help, im trying to something like this:

a file or a process that is always running and pinging for example
returning 1 or 0, when returns 0 (that means have no response) do something else.
i already made the something else, basicly sends an email etc.

Can someone help me on this please ?

Best regards.
Old 07-20-2010, 12:13 PM   #2
LQ Newbie
Registered: Mar 2006
Posts: 14

Rep: Reputation: 2
How about something like this?



send_email() {
echo "FAIL." | mail -s "ERROR" $1

while true; do
if [ $? -ne 0 ]; then


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Email output of Cron command, sends email but no content? the182guy Linux - Newbie 4 05-28-2010 10:52 AM
How to configure an email server that sends email to hotmail with Fedora? acarri Linux - Server 5 03-10-2010 03:05 AM
Bash script to check if process is running and send email depam Linux - Newbie 2 04-08-2009 01:11 AM
POSTIX Sends Hostname in Email carlosinfl Linux - Server 6 01-15-2008 03:13 PM

All times are GMT -5. The time now is 11:23 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration