One of the features of your cPanel on your hosting account is the ability to create cron jobs. These are scripts that are scheduled to run at specified times and are set within your cPanel. There is an option on the setting screen that allows you to enter an email address so you are notified when a cron job finishes. There are times, however, when you may not get the email for some cron jobs but may for others. Below are the steps to take to ensure you always get an email after every cron.

How to be sure you get an email after every cron job

  1. First, log into your cPanel.
  2. Once you are in the main cpanel area, find the Advanced category. and click on the cron jobs icon.

    cron jobs tool icon
  3. This leads you to the cron job setup screen. At the top you will see a Cron Email setting. This is where you will enter the email address to which you want to receive notice after every cron job. If you do not see an email address next to Current email:, you will need to enter one so you begin to receive emails.
    cron email setting
  4. If you see an email address listed there and are still not receiving an email for one of more of your cron jobs, you need to ensure that those particular cron jobs are producing output. Any cron job that does not produce output will not send an email. To ensure some sort of output we need to edit the script itself. Look at the path of the cron job so you know where to edit the script. Write down the path if necessary so you do not forget.
    scheduled cron jobs
  5. Once we know where the script is located, return to the main cPanel page. From here, open up the File Manager located in the Files category.
  6. Navigate to your script's location once inside the File Manager. Below, you will see our script, named mytestscript.php, is located in the public_html folder. Find your particular script file, highlight it, and then click on the Edit icon from the upper toolbar of the screen. You will be greeted with a popup. Click on the Edit button to open the editor.
    edit the cron script file
  7. Inside the file, we want to add a single line to ensure there is some output. We will add a simple echo statement for our output.
    echo "cron job completed";
    This output can be anything, a single word or sentence will do. Also, be sure you enter the line of code is before the php closing tag ?> of your script.
  8. Once entered, click on the Save Changes button at the top of the screen. You will now receive an email every time the cron job runs. Repeat the procedure for any other cron jobs that are not sending you an email.

 

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve our Help Center:
Email Address
Optional, but our team may contact you for more information.
Did you find this article helpful?

Post a Comment

Name:
Email Address:
Comment:
Are you a bot?
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

News / Announcements

Update to SSL Certificates - Certificate Warnings
1969-12-31 11:00 am EST
Hits: 679

Related Questions

Here are a few questions related to this article that our customers have asked:
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.