LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 09-17-2007, 02:23 PM   #1
eggsmartha
LQ Newbie
 
Registered: Sep 2007
Posts: 2

Rep: Reputation: 0
cron hourly, daily, cron.d jobs don't execute


I'm running OpenSuse 10.2 and am having trouble getting jobs in cron.hourly, daily, or cron.d to run. The cron daemon is running, and when I enter a job to execute using crontab -e or just edit /etc/crontab, the jobs do run, but when I put a script into /etc/cron.d it doesn't run (for example, I have a script called testrun with permissions set to 0644 sitting in /etc/cron.d. In this file is the line */1 * * * * /bin/echo "test job executed" >> /var/log/messages. When I do a tail on /var/log/messages I see that the cron daemon reloads this file, but then I never see the line echo'd which would indicate that it actually ran. When I put the same line into /etc/crontab it runs fine and I see the message "test job executed" in /var/log/messages. Any ideas?
 
Old 09-17-2007, 02:33 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
cron on my system (Slackware) uses scripts with the execute bits set in /etc/cron.daily - they're all 0755 rather than 0644. I don't know what flavour of cron that OpenSuse uses, but can you try changing the permissions to allow the scripts to execute and see if that makes a difference?
 
Old 09-17-2007, 02:52 PM   #3
eggsmartha
LQ Newbie
 
Registered: Sep 2007
Posts: 2

Original Poster
Rep: Reputation: 0
I get a message saying "BAD FILE MODE" when I try that. I did just try modifying the entry to read */1 * * * * root /bin/echo... and the thing worked. How does adding "root" in there help things out? I don't see this documented anywhere.
 
Old 09-17-2007, 06:37 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
It looks like the version of cron shipped with OpenSuse requires you to specify the user that the cron job is run as in the crontab. There's some general info at Packaging/SUSE Package Conventions/Cron Jobs which may help.

The bad file mode error is odd. Did you run something like this (as root)?:
Code:
chmod -c 0700 /etc/cron.daily/scriptname
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
How to run jobs in /etc/cron.daily? Micro420 Linux - Newbie 4 10-19-2006 02:07 PM
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
logging daily cron jobs in separate files csmwlee Linux - Newbie 5 10-10-2005 10:30 AM
Daily Cron jobs with a PHP file Gargomel7 Programming 7 09-13-2003 07:21 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration