Thanks for all the great replies, I believe Ruby outputs the same so your method would work Marcus I shall give it a shot anyhow!<br><br>Many thanks,<br>Will<br><br><div class="gmail_quote">On Wed, Mar 4, 2009 at 5:26 PM, Marcus Taylor <span dir="ltr"><<a href="mailto:marcus@fatbeehive.com" target="_blank">marcus@fatbeehive.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>On Wed, March 4, 2009 15:40, Richard Jones wrote:<br>
> On Wed, Mar 04, 2009 at 03:24:16PM +0000, william pink wrote:<br>
><br>
</div><div> What I really want to do is send out a email<br>
>> if theres a error, there is a bash script that runs a Ruby rake task so<br>
>> I presume there is a<br>
>> way of manipulating the output of that or perhaps log to a file that can<br>
>> be tailed+grepped for any obvious error keywords (which doesn't sound<br>
>> like a great solution).<br>
><br>
> I was fairly sure that MAILTO doesn't send mail if the job is silent.<br>
> So the solution would be to make the job only print stuff on error :-)<br>
<br>
</div>I assume you are looking for errors from the Ruby rake script?<br>
<br>
I would edit the bash script to check for the errors from the Rake script<br>
[either by parsing the output of checking the status of the exit variable]<br>
- you can them just pass these on or create your own errors messages.<br>
<br>
I would then echo these errors messages [if any] to stderr [ echo "$blah"<br>
>&2 ] in the bash script.<br>
<br>
Then in the cron line redirect stdout to >/dev/null and leave stderr alone.<br>
<br>
This may not be possible with Ruby/rake scripts - TBH I have no idea what<br>
a rake script/task consists of.<br>
<br>
Cheers<br>
<font color="#888888">Marcus<br>
</font><div><div></div><div><br>
--<br>
Gllug mailing list - <a href="mailto:Gllug@gllug.org.uk" target="_blank">Gllug@gllug.org.uk</a><br>
<a href="http://lists.gllug.org.uk/mailman/listinfo/gllug" target="_blank">http://lists.gllug.org.uk/mailman/listinfo/gllug</a><br>
</div></div></blockquote></div><br>