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. |
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? |
try
Code:
export PATH=$PATH:/usr/bin/FWTools-1.1.3/bin_safe Code:
PATH=$PATH:/usr/bin/FWTools-1.1.3/bin_safe |
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 |
Why not simply put a link to goastro in /etc/cron.hourly
|
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 |
Code:
-rwxr-xrwx 1 root root 747 2007-01-09 19:58 crontab |
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 ?? :scratch:
|
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. |
All times are GMT -5. The time now is 06:35 AM. |