Search Our Database

How to Enable Email Notifications of Cron Jobs in cPanel

Last updated on |
by

Introduction

This Knowledge Base article provides a simple, step-by-step guide on How to Enable Email Notifications of Cron Jobs in cPanel. Cron email notifications are useful because they keep you informed whenever your scheduled cron jobs are executed. By enabling this feature, you can easily monitor whether tasks are running successfully and review any output or errors that may occur. Setting up an email address for cron job notifications ensures better tracking and helps with troubleshooting automated tasks.

Prerequisite

  • Access to your cPanel login page.
  • A valid email address to receive notifications.

Step-by-Step Guide

Step 1: Log in to cPanel

  • Access and log in to your cPanel account using your username and password.

Step 2: Open Cron Jobs

  • In the Home page, under Advanced, click Cron Jobs.

Step 3: Locate the Cron Email Section

  • At the top of the Cron Jobs interface, find the Cron Email section.
  • Click More to expand the interface.

Step 4: Enter Email Address

  • In the Email text box, type the email address where you want to receive notifications.

Step 5: Update the Email Address

  • Click Update Email to save your changes.

⚠️ Important Note:

  • Cron jobs only send email notifications if the command generates output on stdout (standard output) or stderr (standard error).
    • stdout is the normal output of a command (for example, echo “Hello World”).
    • stderr is the error output when a command fails (for example, ls /nonexistentfolder).
  • If all output is redirected to a file or to /dev/null, no email will be sent. For example:
    • echo “Test” >> /home/username/logfile.log → No email, because output is redirected to a file.
    • mycommand >/dev/null 2>&1 → No email, because both stdout and stderr are discarded. To receive email notifications, ensure the command produces output without fully redirecting it away.

 

Step 6: Verify the Changes

  • A success message will appear confirming the update.
  • Additionally, check the Current Email displayed under the Cron Email section to ensure it matches the address you entered.

Conclusion

By following these steps, you can easily enable email notifications for cron jobs in cPanel. This helps you stay informed about the execution status of your scheduled tasks and makes it easier to detect issues early. Regularly monitoring the emails ensures that your cron jobs are working as intended.

Should you encounter any issues or have any questions, our support team at IPSERVERONE is always here to assist you. Don’t hesitate to reach out to us at support@ipserverone.com for any help you need.