LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-29-2006, 12:12 PM   #1
rsmccain
Member
 
Registered: Apr 2004
Location: Louisiana
Distribution: SUSE
Posts: 154

Rep: Reputation: 30
cron doesnt seem to be working


This is on a SLES (Suse Linux Enterprise Server) 9 server.

We noticed a new cron job we put into place in /etc/cron.daily wasn't running. I then created a cron job via crontab -e to run every minute:

1 * * * * /usr/bin/touch /root/test.file

The file never gets created. I verified the cron daemon is running.

Any troubleshooting suggestions?

Thanks.
 
Old 06-29-2006, 01:51 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
D'oh - deleted - missed that you'd said you verified the daemon was running.

Is there a /var/log/cron and if so have you checked it?

Last edited by MensaWater; 06-29-2006 at 01:54 PM.
 
Old 06-29-2006, 01:55 PM   #3
rsmccain
Member
 
Registered: Apr 2004
Location: Louisiana
Distribution: SUSE
Posts: 154

Original Poster
Rep: Reputation: 30
more info

Quote:
Originally Posted by rsmccain
This is on a SLES (Suse Linux Enterprise Server) 9 server.

We noticed a new cron job we put into place in /etc/cron.daily wasn't running. I then created a cron job via crontab -e to run every minute:

1 * * * * /usr/bin/touch /root/test.file

The file never gets created. I verified the cron daemon is running.

Any troubleshooting suggestions?

Thanks.
i got the entry in crontab -e working by changing the "1" to "*". However, nothing in cron.daily seems to be working. Is it possible to setup cron so it logs results for each cron job being run in cron.houry?

Thanks.
 
Old 06-29-2006, 02:18 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
/var/log/cron should give you entries as to which jobs run but won't give you full detail. You can get that by changing the entry to:

Code:
1 * * * * /usr/bin/touch /root/test.file >/tmp/touch.log 2>&1
/var/log/cron will let you know if it got scheduld to run. If it did then /tmp/touch.log will let you know what happened when it tried.

Also I did a test with this on my Fedora Core 4 box and found it didn't kick off until cron.hourly ran (even though there is nothing in cron.hourly directory). It may be that Linux cron (unlike Unix cron) only updates the schedule once an hour. Your change to "*" in the first position may simply have happened just before the last hour mark so may not have been why it ran. Unfortunately I don't see anything in the crond or crontab man page to state this. Doing a sighup of crond didn't help nor did a stop and start of the service.
 
Old 06-30-2006, 12:24 AM   #5
avijitp
Member
 
Registered: May 2005
Location: India
Distribution: FC11, Debian/Ubuntu, RHEL, Solaris, AIX, HP-UX
Posts: 161

Rep: Reputation: 32
Check the /etc/crontab file to see when the daily conjob is scheduled to run and then check the /var/log/cron to see if the cron got executed.

If the cron is being run as a general user , he will not be able to write to /root ( roots home Dir ).
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron not seeming to be working? MadCactus Red Hat 2 09-09-2006 11:31 AM
Cron not working robbiemorgan Linux - Newbie 6 09-16-2004 10:47 AM
a ./configure doesnt see any working posix threads RokOne Linux - Software 0 04-06-2004 08:06 PM
Cron/at not working Wynd Linux - General 1 09-11-2003 11:22 PM
RH 7.1, XServer is doesnt start, was working fine before DoubleLetter Linux - Software 9 08-01-2001 06:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:47 PM.

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