LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-01-2012, 07:00 AM   #1
bic
Member
 
Registered: Jan 2005
Distribution: MythDora 3.2, RHEL 6.3
Posts: 101

Rep: Reputation: 16
cron manager


I'm looking for an application that will allow me to see cron job status with information such as shell script to run, last run, exit code, next run, duration, is it running / pid etc..

I don't need to modify cron, but really just an overview of what's going on.

I'd really like no dependencies on php/Apache etc (though maybe there's a shell script that can report to a host that would have Apache on it).
 
Old 05-01-2012, 07:41 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
crond, the cron daemon, writes entries into /var/log/cron and that crond has optional logging levels, 1 being lots of stuff, 5 (the default) being not much at all.

Level 5 is notice (crond is started with -l notice); if you change that to starting crond with -l info you'll get much of what you probably are interested in.

The levels (from the crond manual page) are alert, crit, debug, emerg, err, error (deprecated synonym for err), info, notice, panic (deprecated synonym for emerg), warning, warn (deprecated synonym for warning).

The log entries will tell you much of what you're interested in knowing (and a whole lot that you're most likely not interested in) and a little awk program might be useful for filtering out what you don't want to know. I don't know of a specific application for doing this but it's pretty simple to just change the logging level and keep an eye on the log.

To change the logging level, locate the script in your system start up directory (such as /etc/rc.d, /etc/rcn.d) -- it'll look something like this:
Code:
# Start crond (Dillon's crond):
# If you want cron to actually log activity to /var/log/cron, then change
# -l notice to -l info to increase the logging level.
if [ -x /usr/sbin/crond ]; then
  /usr/sbin/crond -l notice
fi
and change the notice to, say, info. You'll probably need to reboot (easy) or stop and restart crond (run ps -ef | grep crond to get the PID, kill -9 and PID number, and start crond with /usr/sbin/crond -l info).

See the manual pages for crond, logger(1), and syslog(3).

Give it try and see what you get.

Hope this helps some.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Cron directories: /var/spool/cron/cron.GfqqGO Woodsman Slackware 4 05-11-2011 02:37 PM
Simulate cron with screen manager kaszynek Linux - Software 3 11-10-2010 04:00 PM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration