Showing results for 
Search instead for 
Did you mean: 

crontab log

Super Advisor

crontab log

how to check my cron job running status

Honored Contributor

Re: crontab log

If your cron job does not do anything to make itself easier to find, your options are to read the cron logfile (/var/adm/cron/log) or use the ps command (like "ps -fu <username>") to see if it is currently running.


If you don't redirect the standard output and/or standard error output of the cron job, the output will by default be mailed to you (if the mail system has default configuration, it will end up to your local email inbox file, /var/mail/<username>).


If your cron job is a script, you can make it easier to find by adding a command like this to the beginning of the script:

echo "$$" >/some/


This creates a pid file for the job, which allows you to make several checks:

  • If /some/ exists, the cron job has been started at least once
  • the timestamp of the file will tell you the last time the cron job actually started
  • "ps -fp $(</some/" will list the cron job process if it is still running
  • if you need some other script to know if the cron job is currently running, you can do it like this:

# kill -0 only tests if a given PID exists
if kill -0 $(</some/; then
    echo "Yes, the job is still running."
    echo "No, the job is not running right now."