I have this user who have a lot of cron jobs and I expected it to log stderr in its /var/mail/user. Sample below cron entry is working as expected in a different server.

* 30 * * * * /usr/local/bin/scripts/test.sh > /dev/null 2>&1

I've compared postfix/main.cf on both servers and cannot find anything different. Is there something else I need to check?


This is an explicit redirection in the cron command: > /dev/null 2>&1. It means both stdout and stderr are thrown away. There's no basis to expect any mail then. To keep stderr, leave just this redirection at the end: >/dev/null.

  • Thank you so much this have been very helpful. I overlooked those redirections when comparing from another working system. – Ykaly Jun 25 '19 at 19:08

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.