OS: ubuntu 10.04 LTS
Hey guys
Were using a script which makes an update daily on our ubuntu machine
And the cron deamon gives a notification by mail
And alway Comes the following : stdin: is not a tty
This line i will comment out and no notifications should be sent if this error occours
Some time ago i've found a method to supress Output directly in crontab
But cannot find it anymore
Does anybody konw how to do that ?
regards John s.
The answer to your question is the following:
Redirect stderr to stdout, then pipe all output through
grep -v
to remove that unwanted error.Edit: slapping this in without investigating any further is a quick and dirty fix. Do it if you just need to silence those pesky emails and move on. However, you may find it more educational/beneficial in the long run to try to figure out what's causing the error, and stop it. Then, for example, if you add more cron jobs, you wouldn't have to keep adding this to every one. In the end though, you may find you have to do it anyway if it's not easy to fix the offending command.
Googling around suggests it may be caused by something in your .bashrc or /root/.profile. Check those, and fix them if needed (possibly changing
mesg -n
totty -s && mesg -n
).Update your question with more information if you can't get to the bottom of it or need more ideas.