LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-09-2007, 02:39 PM   #1
JBull
Member
 
Registered: Jul 2005
Location: Dallas, TX, USA
Distribution: Debian Etch
Posts: 37

Rep: Reputation: 15
Cant' Cron on new install


New Debian Sarge install, my crontab is not working.

I have a script that I want to execute and I put in in /etc/crontab

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/FWTools-1.1.3/bin_safe/

# m h dom mon dow user command
30 * * * * root /usr/local/FWTools-1.1.3/bin_safe/goastro
30 * * * * root run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly
#

But it never runs. My old Debian Sarge machine worked fine. What's the problem? The script goastro is a bash script with a+x permissions. I'm logged in to Gnome as regular user, but edit crontab as root. Please help figure out why crontab does not start goastro.

I've aslo tried to crontab -e and put in spooler but that won't go either. crontab -l gives the correct info for root.
 
Old 01-09-2007, 07:46 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
What are the access rights of /etc/crontab?
Do the other jobs run OK or not?
Are there any emailed errors?
What does the log say?
 
Old 01-09-2007, 07:55 PM   #3
xjlittle
Member
 
Registered: Aug 2003
Location: Indiana
Distribution: fc6 sles9 & 10 kubuntu ubuntu-server
Posts: 240
Blog Entries: 2

Rep: Reputation: 30
try
Code:
export PATH=$PATH:/usr/bin/FWTools-1.1.3/bin_safe
or
Code:
PATH=$PATH:/usr/bin/FWTools-1.1.3/bin_safe
export PATH
They both do the same thing just a different way of writing it. $PATH is a shortcut your normal environment variable that should include what you have there. If you need another path just tack it onto the end.

Last edited by xjlittle; 01-09-2007 at 07:57 PM.
 
Old 01-09-2007, 08:24 PM   #4
JBull
Member
 
Registered: Jul 2005
Location: Dallas, TX, USA
Distribution: Debian Etch
Posts: 37

Original Poster
Rep: Reputation: 15
I tried the export PATH command.

#echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin:/usr/local/FWTools-1.1.3/bin_safe

#goastro
in a terminal window from any directory and the script runs fine. I also tried adding the full path-to-goastro in crontab. Still not working.


#ls -l
-rwxr-xrwx 1 root root 747 2007-01-09 19:58 crontab

There is no /var/log/cronrun logfile. Also there is no /etc/cron.allow or /etc/cron.deny

Here is my current complete crontab:


# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file.
# This file also has a username field, that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/FWTools-1.1.3/bin_safe/

# m h dom mon dow user command
05 * * * * root /usr/local/FWTools-1.1.3/bin_safe/goastro
30 * * * * root run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly
#


No email notifications are sent.

Inside goastro are the following three scripts:
getdata.sh
process.py
buildhtml.py

Each of these reside in /usr/local/FWTools-1.1.3/bin_safe/

$ls -l /usr/local/FWTools-1.1.3/bin_safe
-rwxr-xr-x 1 root root 66 2007-01-09 00:27 goastro
-rwxr-xr-x 1 root root 629 2006-12-17 19:59 getdata.sh
-rwxr-xr-x 1 root root 2451 2007-01-01 16:23 process.py
-rwxr-xr-x 1 root root 1210 2007-01-01 13:22 buildhtml.py

Last edited by JBull; 01-09-2007 at 08:25 PM.
 
Old 01-09-2007, 08:31 PM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Why not simply put a link to goastro in /etc/cron.hourly
 
Old 01-09-2007, 08:36 PM   #6
JBull
Member
 
Registered: Jul 2005
Location: Dallas, TX, USA
Distribution: Debian Etch
Posts: 37

Original Poster
Rep: Reputation: 15
Tried it in cron.hourly first but it didn't work. Now I've tried it in /etc/crontab and also from
$crontab -e

My solution for now is walking up to my computer about once an hour and typing

$goastro

Last edited by JBull; 01-09-2007 at 08:39 PM.
 
Old 01-10-2007, 03:54 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Code:
-rwxr-xrwx 1 root root 747 2007-01-09 19:58 crontab
what happens if you chmod 0644 /etc/crontab (unless you run crond -p)?
 
Old 01-13-2007, 02:21 AM   #8
JBull
Member
 
Registered: Jul 2005
Location: Dallas, TX, USA
Distribution: Debian Etch
Posts: 37

Original Poster
Rep: Reputation: 15
It is working now & I dont know why. I came home from work yesterday and all my scripts had run. Maybe it was a reboot ??
 
Old 01-13-2007, 04:48 PM   #9
JBull
Member
 
Registered: Jul 2005
Location: Dallas, TX, USA
Distribution: Debian Etch
Posts: 37

Original Poster
Rep: Reputation: 15
OK, I have a part of the problem figured out.
Crontab jobs run according to local time.
My jobs are scheduled for specific hours based on UT (GMT).
I use UT because my scripts get worldwide forecast data, which are based on UT and issued at the hours 0UT, 6UT, 12UT, 18UT.

My clock in Gnome is set for 24 hour UT time format but cron was using local time. The solution was change the crontab schedule to local time.

Last edited by JBull; 01-13-2007 at 05:10 PM.
 
  


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
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 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
[cron][mdk9.1]cron deamon seems to ignore some task... yannrichet Linux - Newbie 5 06-26-2003 09:57 AM
dual entries in cron log for cron.daily cpharvey Linux - General 3 02-27-2003 02:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:07 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