A cron job is a time-based task that is set to run at certain intervals from within your cpanel. It sets a particular script to run at a specific time or times on autopilot. There are different types fo cron jobs. Some produce output and others do not. It is easier to determine if the cron ran for those that produce output (a file, email, or webpage output). Howeve, for those that simply perform taske behind the scene, you will need to tap into the server logs to determine if they have run. Below is a quick tutorial on checking your cron logs to determine if a job has run as it was scheduled.

Note that to perform this function you will need to have root access on your VPS or dedicated server.

Checking your Cron job via server logs

  1. Open your preferred your ssh client. If you need an ssh client, we recommend PuTTY. You can download it here.
  2. Log into your server via your ssh client.
  3. Once logged in as the root user, use the following command to check the log for the cron script. The command will use the following format: grep "script.php" /path/file.ext. For instance, the code below is looking for the script cronscript.php in the cron.log file, which is in the /var/log folder.

    grep "cronscript.php" /var/log/cron.log
  4. Hit Enter after that and the results, if any, will display like below:

    Feb 24 02:33:02 ecbiz108 crond[9772]: (userna5) CMD (php -q /home/userna5/public_html/cronscript.php)
    Feb 25 02:33:01 ecbiz108 crond[16587]: (userna5) CMD (php -q /home/userna5/public_html/cronscript.php)
    Feb 25 11:45:01 ecbiz108 crond[21887]: (userna5) CMD (php -q /home/userna5/public_html/cronscript.php)
  5. Looking at the output, you will see the date and time the cron job has run. This is followed by the server name, cron ID, the cpanel username, and the command that ran. At the end of the command, you will see the name of the script.
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 this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

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

News / Announcements

WordPress wp-login.php brute force attack
Updated 2014-07-17 06:43 pm EST
Hits: 201691

Related Questions

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

Need more Help?

Search

Ask the Community!

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

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!