Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 May 2005 15:15:49 -0700
From:      Danny Howard <dannyman@toldme.com>
To:        Jim Pazarena <fquest@ccstores.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: syslogd and pipe to email
Message-ID:  <429CE215.6090904@toldme.com>
In-Reply-To: <429AB4BD.9030108@ccstores.com>
References:  <429AB4BD.9030108@ccstores.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Jim Pazarena wrote:

> I would rather have a script which waits at least 30 seconds
> before terminating rather than after one line, because some
> of the records I am looking for are multi-line, and I'm not
> sure if a script can be made to timeout. 

Jim,

Even without setting up some sort of fancy interrupt thing, of course 
you can get a script to time out.

In fact, I think you'd WANT the script to time out, even if it was 
getting input from syslog, because if syslog were spewing warning 
messages, you'd want the script to let go and send its warnings.

Script would look something like:
to=30
while( to > 0 )
    output .= <STDIN>
    sleep 1
    to--
do send-email

Cheers,
-danny

-- 
http://dannyman.toldme.com/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?429CE215.6090904>