InMotion Hosting Support Center

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 of 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). However, for those that simply perform tasks 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
  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.
Was this article helpful?

Related Questions

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

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

n/a Points
2018-02-09 3:06 pm

What has happened.My cron jobs could no longer run and crontab -l can no  list any of my cron jobs

2,863 Points
2018-02-09 3:14 pm
I recommend you check the logs as indicated in this guide to determine why the cronjob is not running as expected.

I also recommend you check what user you are using for SSH and what user is running the cronjobs to figure out why crontab is not displaying anything.

I do apologize, however, I am not able to determine why your cronjob is not working, with the details you have provided.
n/a Points
2017-10-09 9:18 am
Just a quick tip if you're looking for a cron job that ran in the past run grep "cronscript.php" /var/log/cron-20171008 (which says cron file that is logged at 2017-10-08)
n/a Points
2016-06-08 12:16 pm

Do we have to put a reference to the cron job in the php file and if how?

10,077 Points
2016-06-08 2:18 pm
Hello Simon,

You should not have to, is the code above not working for you?

Best Regards,
TJ Edens
n/a Points
2015-12-29 5:55 am

i want to find how many jobs are running and on which server  these things i want but didnt get using these commond plz help me. 


10,734 Points
2015-12-29 3:10 pm
Hello Sreenu,

You can see any crons running on the server by checking /var/spool/cron for the given user. And you will see the active crons running in the chosen user's "crontab".
n/a Points
2015-07-23 3:30 am

#/var/log/syslog   command running the cron Job.




Praveen Kumar verma

n/a Points
2015-08-19 1:33 pm

cronjob running status check in linux

n/a Points
2015-03-05 6:56 pm

Typo "...different types fo cron jobs..."

10,077 Points
2015-03-06 10:36 am
Hello Hrynkiw,

Thank you for catching that, I have fixed the typo.

Best Regards,
TJ Edens
n/a Points
2015-03-04 2:30 am
I do not want to have to login via ssh to find out what happened with my cron job. I have an email address associated with that job and I want to get an email telling me if the job ran correctly or not. I currently get an email on one of my other jobs, so why am I not getting one on this cron? It is:
find public_html/test -type f -name "*-invoicePDF*"
10,077 Points
2015-03-06 10:38 am
Hello Kenny,

If you have a mailto line setup within your crontab then you should get emails from any failing cron jobs.

Best Regards,
TJ Edens
n/a Points
2015-02-25 12:55 am
I think this article is right to the point and let us know where to look exactly. No need for any improvement acc to me.


Post a Comment

Email Address:
Phone Number:

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

18 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


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:
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!