Disabling email notifications from cron jobs
Ce contenu n’est pas encore disponible dans votre langue.
Cron sends an email whenever a cron job produces output. You can stop these emails for all cron jobs, or for one cron job at a time.
Stop emails for all cron jobs
Section titled “Stop emails for all cron jobs”- Log in to cPanel.
- In the Advanced section, click Cron Jobs.
- Under Cron Email, delete the email address.
- Click Update Email.
No cron job on your account will send emails after this.
Stop emails for one cron job
Section titled “Stop emails for one cron job”Add this to the end of the cron job’s command:
> /dev/null 2>&1This sends all the command’s output, including errors, to /dev/null, where it’s discarded. For example:
15 * * * 0 /home/username/bigtask.sh > /dev/null 2>&1To edit an existing cron job, click Edit next to it under Current Cron Jobs, update the command and click Edit Line.
Keep error emails only
Section titled “Keep error emails only”If you want to hear about errors but not normal output, discard only the standard output:
15 * * * 0 /home/username/bigtask.sh > /dev/nullTo start receiving emails again, remove the redirect from the command, or add an email address under Cron Email.
Related articles
Section titled “Related articles”Cette page vous a-t-elle aidé ?
Merci pour votre retour.