On Mon, Nov 26, 2012 at 12:32 AM, Mihamina Rakotomandimby mihamina@rktmb.org wrote:
I have "MAILTO=root" in the file. If I make a CLI test to mail to root, all is working.
Is there a special feature such as "it only mail if STDERR"? Because all the messages (rsync output + echo "foo") is to STDOUT.
I cant find any doc about that. I suspect the thing to mail only if it's an error message...
You can redirect stdout to /dev/null if you don't ever want it. Then cron will only send mail if something is written to stderr. If you want to collect stdout but discard it unless there is error output you'll have to mange a tmp file yourself.