Aller au contenu

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.

  1. Log in to cPanel.
  2. In the Advanced section, click Cron Jobs.
  3. Under Cron Email, delete the email address.
  4. Click Update Email.

No cron job on your account will send emails after this.

Add this to the end of the cron job’s command:

> /dev/null 2>&1

This 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>&1

To edit an existing cron job, click Edit next to it under Current Cron Jobs, update the command and click Edit Line.

If you want to hear about errors but not normal output, discard only the standard output:

15 * * * 0 /home/username/bigtask.sh > /dev/null

To start receiving emails again, remove the redirect from the command, or add an email address under Cron Email.

Cette page vous a-t-elle aidé ?