0

I am currently getting cron error mails which need to be ignored. But Ignoring those mails did not cut it as there would be 6-8 mails sent at a time from Cron on a particular day.

Is there a piece of code that could ignore those particular mails, using keywords for suppressing those mails?

2

Depends on how your crontab is set up - to run the actual task, or call a shell script that then runs your actual task.

Either way, if any output is generated (stdout or stderr) then it will be sent via email. Only way around this is to redirect output to /dev/null or a log file. You may want to read up on I/O redirection

| improve this answer | |
  • Redirecting to a log file might eat up all the memory allotted to the log file, which is very less. I checked the process of redirecting to /dev/null, this seems like a viable option. But I donot want all the outputs/error mails to be re-directed to /dev/null. Is there a way to re-direct a particular O/P or error mail to /dev/null ? – UnknownHost Jun 13 '17 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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