When a cron job is configured, by default, the output of the cron job is emailed to the registered email ID used while setting up the cPanel or server.
It is a good practice to get an update about the cron job of the website via email, but it can flood the inbox.
If the cron job is scheduled to run frequently (e.g., every minute) and encounters repeated errors.
In order to avoid unnecessary emails, you can disable email notifications for failed cron jobs via SSH in Magento 2.
In this blog, you can find the solution to fix this issue additionally, you can use this solution, especially in the production mode where the cron is scheduled every minute and if it continuously throws an error.
Solution to Disable Email Notifications for Failed Cron Jobs via SSH in Magento 2
Here is the original command that we used to run Magento 2 cron tasks every minute and log the output.
* * * * * /phpPath/php /DirPath/magento2/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /DirPath/magento2/var/log/magento.cron.log
To prevent the failed cron job email sending, you will need to modify the above original command and use the below command:
* * * * * /phpPath/php /DirPath/magento2/bin/magento cron:run > /dev/null 2>&1 | grep -v "Ran jobs by schedule" >> /DirPath/magento2/var/log/magento.cron.log
Try this solution now and get rid of bulk emails for the failed cron jobs.