Disable Crontab Email Notifications suppress cron

Today, We want to share with you Disable Crontab Email Notifications suppress cron.In this post we will show you How to disable e-mail notifications from cron jobs, hear for Disable The Mail Alert By Crontab Command On a Linux or Unix we will give you demo and example for implement.In this post, we will learn about How to disable e-mail notifications from a specific cron job with an example.

Disable Crontab Email Notifications suppress cron

There are the Following The simple About Disable Crontab Email Notifications suppress cron Full Information With Example and source code.

As I will cover this Post with live Working example to develop disable cron email notifications, so the some How to stop (Cron Daemon) sending multiple emails for this example is following below.

We can easily Disable The Mail Alert By Crontab Command On a Linux or Unix output of any crontab examples by redirecting output to /dev/null. We can do this by appending >/dev/null 2>&1 to crontab examples, for which We want to disable e-mail notifications from cron jobs output.

  • 1 : The Unix Command >/dev/null says the cron to send all output (STDOUT) to /dev/null
  • 2: The 2>@1 says the cron jobs to send all errors (STDERR) to same as (STDOUT)
0 2 * * * /home/backup.sh >/dev/null 2>&1

Crontab Using MAILTO Option

Set MAILTO variable using crontab

$ crontab -e and MAILTO=””

MAILTO=""
0 2 * * * /home/backup.sh >/dev/null 2>&1

MAILTO="[email protected]"
0 2 * * * /home/backup.sh >/dev/null 2>&1

Cron job example

Edit/Open your cron jobs

$ crontab -e

Append string >/dev/null 2>&1 to stop mail

0 1 5 10 * /path/to/script.sh >/dev/null 2>&1
//or
0 1 5 10 * /path/to/script.sh > /dev/null
//or
0 * * * * /path/to/command arg1 > /dev/null 2>&1 || true
Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Disable Crontab Email Notifications suppress cron.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment