Diagnosing Failed 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.

ref: http://www.inmotionhosting.com/support/website/cron-jobs/did-cron-job-run




Comments

Popular posts from this blog

RMAN backup Status (Remaining Time and Percentage)

EBS R12.2 Autoconfig Failed. Resolved

ADOP options availble in R12.2