Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having a small issue, i'm running and cron task every 5 minutes which is looking text chain and replacing it with nothing.. In order to optmize something i would like to add a new function to my cronstrask : send me an email if it replaces something.. if the crontask does not find the chain no need to send a mail. I have no idea how to do that , maybe you can help me . Here is my current cron task :

find /home -type f | xargs sed -i 's$chain if would like to era$ $g'
share|improve this question

closed as not a real question by Andrew, Jenny D, Ward, mdpc, Michael Hampton Apr 20 '13 at 6:34

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Write a script. Call your script from Cron. – Zoredache Apr 18 '13 at 22:33

By design, cron emails the output of any job to the MAILTO variable, or if that is not set, the owner of the job (e.g. root) is email. Call your script from cron and set the correct email alias, and you'll get mail if the script produces output.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.