LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-05-2007, 03:18 PM   #1
chnlinux
LQ Newbie
 
Registered: Jun 2007
Posts: 28

Rep: Reputation: 15
Command to check cronjob service


Hi ,

I want to know which command we have to use to check wether the cronjob service is running or not.I am getting error file not found when running a cron job.What could be the problem


Thanks/ChnLinux
 
Old 06-05-2007, 03:52 PM   #2
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
The command:
Code:
ps -aux |grep crond
should tell you if cron is running, but that doesn't sound like your problem.

It sounds as if the cron entry is pointing to a command that doesn't exist, or the command is trying to access a file that doesn't exist.

Hope this helps.
 
Old 06-05-2007, 05:48 PM   #3
lakris
Member
 
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102

Rep: Reputation: 15
You can also use the command
/etc/init.d/cron restart
to make sure it is running (name and location may differ for You).
There could be a lot of things...
What does Your cronjob/crontab look like?
Do You run it through the predefined script locations in /etc/cron.* or schedule it Yourself with crontab?
As what user?
Is it executable?
Does the crontab use the full filename of Your script?
Grep for CRON in var/log/messages, /var/log/syslog or ANY logfile there.
Check for working directory, check for "shebang", check for path; if You run a script start it with #!/bin/bash to have a known shell, use ' . /etc/profile ' to get a known environment, use poor mans debugging! ie, echo status to an absolute filename.

It could help if You told us more!

Last edited by lakris; 06-05-2007 at 05:51 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
nagios check service noir911 Linux - Networking 5 07-24-2006 06:12 PM
Cronjob problem. Unknown Command dragunu Linux - Newbie 1 05-16-2006 01:47 PM
way to check and see if a service is running nephish Linux - Software 10 02-11-2006 04:36 PM
Service check script assafde Linux - Networking 1 02-02-2006 07:46 PM
Service check script MPowers Linux - Networking 1 01-24-2006 01:42 AM


All times are GMT -5. The time now is 11:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration