To disable the email alert generated by the crontab command on a Linux or Unix-like system, you can use the following steps:
crontab -e
MAILTO=""
This will prevent any email alerts from being sent by the crontab command.
Alternatively, you can also specify the MAILTO
variable at the beginning of each line in the crontab file to control whether an email alert should be sent for that particular cron job. For example:
MAILTO="" 0 0 * * * /path/to/command
This will prevent an email alert from being sent for the cron job that runs the /path/to/command
command at midnight every day.
Keep in mind that the MAILTO
variable only controls email alerts sent by the crontab command. If a command run by a cron job generates its own email alerts, you will need to modify the command or its configuration to disable those alerts.