[CentOS] CentOS 8.1 cron does not send mail

Thu Feb 27 15:52:18 UTC 2020
Chris Schanzle <chris.schanzle at nist.gov>

On 2/27/20 8:01 AM, Tobias Kirchhofer wrote:
> Hi,
>
> we experience difficulties with crond behaviour sending mail since CentOS 8.1. The cron job is the same like we used in CentOS 7.
>
> crontab -l
> /usr/bin/python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && /usr/local/bin/backup.sh
>
Agreed on the missing timespec (invalid cron line), but why the mile-long python rather than the simpler:

sleep $((RANDOM \% 3600))

Recall percent signs (%) in crontabs means put a newline here, so it needs to be quoted to disable.

Regardless, you say it's not sending mail...that could be silence or say if /usr/bin/python3 didn't exist, should output an error. did you check your mail logs?