Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to know

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
Could someone tell me how to check for the cronjob running or not? I have many cron jobs running background, but recently just 1 or 2 of them died and usually I will get the system alarms me, but guess what this cronjob also died, which I don't know there are some cron job died too.

I can check by listing the crontab -l and check whether the job listed in the crontab list is running at the time desired or not, but I am not sure is there another fater way to check them out?

thanks.
 
normally cron-jobs will give you a line in the system-log with the error-code
 
Hi this process may help you,

I would like to know, after making changes in crontab file, are you getting any error messages like this

cron may not be running - call your system administrator

If yes, then stop and start the cron

#/etc/init.d/cron stop
#/etc/init.d/cron start

If you want to see the output of your job through email, put your emailid in crontab file.

Example:

14 12 * * * df -k | /usr/bin/mail xxx@xxxx.com 2>&1

This commnd will send output of your system disk space


You can see in unix level also.

login as a root, type mail it will display all emails for root.

 
Hi Raja

Yes, it is the way to send message of cronjob through email that I already know, however, not every cronjob I will set up to send email because otherwise I will have more than 100 emails to read everyday and I don't think I am capable to finish them all including with other works !!

and as I said, only some of them don't run, but not all of them, and it is a headache of this kind of problem.
 
/etc/syslog.conf (with the proper settings) and
/etc/default/cron (you should have CRONLOG=YES [the default]
for cron logging) are your friends.



 
If those don't work you could always put flags in you crontab that write to a file. This will show if the crontab actually runs. I assume you've run any cron scripts manually (make sure you are the proper user) to check that they run right.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top