🔥 Just Launched! Werra Premium Template for HyväSee it in Action

Disable Email Notifications for failed Cron Jobs via SSH in Magento 2

By Sanjay JethvaUpdated on Jun 16, 2025 2 min read

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.

Sanjay Jethva Full Image
Article bySanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.