LinuxQuestions.org
Review your favorite Linux distribution.
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 02-16-2005, 09:58 PM   #1
corepuncher
LQ Newbie
 
Registered: Feb 2005
Location: Norman, OK
Distribution: Fedora Core 3
Posts: 12

Rep: Reputation: 0
crontab suddenly stopped working


I have several scripts in a directory to get data via ftp and wget. I have these set up in crontab, under the username gempak.

One night, the crons suddenly stopped working. I can run the scripts manually, and when I cut and paste the full path from crontab into another xterm, it works.

I am outputting logs for each of these scripts. The funny thing is, the time stamp on these logs update and change at the approprate time...only problem is, the scripts are not being run and the log sizes are always 0. I have set permissions to 777, and even tried chown crontab to my username. If I su to root and look at /etc/crontab, it is blank...do I need to change this crontab?

I was making directories the same night, nothing anywhere critical, just some subdirectories in my user account. I accidentally typed "mdir" instead of "mkdir", and my hard drive thrashed for a couple minutes. Not sure what it was doing, or if it has anything to do with why my crons will not run.

Here's an example from my "System logs" window:

Feb 17 03:54:01 localhost crond[25141]: (gempak) CMD (/home/gempak/GEMPAK5.7.4/scripts/getdata/rad >/tmp/rad.log)

There are no funny symbols, so it appears to have run...however, there is no new data in the directory (this cron downloads radar data). I can run this manually and it will work.

Anybody know why the crons will not run? It does not make any sense to me. Thanks,

Ryan

Last edited by corepuncher; 02-17-2005 at 09:31 AM.
 
Old 02-17-2005, 06:53 AM   #2
JunctaJuvant
Member
 
Registered: May 2003
Location: Wageningen, the Netherlands
Distribution: OS X
Posts: 488

Rep: Reputation: 31
See "man mdir": it probably searched for msdos files or something. Maybe I'm wrong, but I don't see how it could affect crontab.
Since the cron jobs ran normally before, I can also see no reason why it should suddenly stop working like that. Nonetheless, maybe you could try editing root's crontab with "crontab -e root" and adding the jobs there.
Hope that helps.
 
Old 02-17-2005, 09:05 PM   #3
corepuncher
LQ Newbie
 
Registered: Feb 2005
Location: Norman, OK
Distribution: Fedora Core 3
Posts: 12

Original Poster
Rep: Reputation: 0
CRONTAB just doesn't work

I copied my crontab into the root crontab, and it still does not work. Same old thing...the time comes for the cron to run, the scripts do not run, but the log files time stamp updates as if the cron runs, with nothing written to the log files. I even tried tying -v at the top of the script and tried >1 and >2.

Could this have anything to do with PATH variable? Something to do with login scripts or something? I'd hate to erase my hard drive for this.

Ryan
 
Old 02-17-2005, 09:42 PM   #4
corepuncher
LQ Newbie
 
Registered: Feb 2005
Location: Norman, OK
Distribution: Fedora Core 3
Posts: 12

Original Poster
Rep: Reputation: 0
source error...a clue...

In my mail, I have this:

<snip>
Subject: Cron <gempak@localhost> /home/gempak/GEMPAK5.7.4/scripts/getdata/vis >/tmp/vis.log
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/gempak>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=gempak>
X-Cron-Env: <USER=gempak>

GEMDATA: Undefined variable

This gets written every time a script tries to run...it doesn't know what GEMDATA is. The funny thing is, I source a file that has all the setenv variables set in my csh.login file.

In addition, at the top of each of my scripts that cron is running, I RE source my file full of variables, so it appears as though my system cannot "source" anything! Thanks,

Ryan

Last edited by corepuncher; 02-17-2005 at 10:00 PM.
 
Old 02-18-2005, 05:57 PM   #5
corepuncher
LQ Newbie
 
Registered: Feb 2005
Location: Norman, OK
Distribution: Fedora Core 3
Posts: 12

Original Poster
Rep: Reputation: 0
Fixed it!

It all came down to a file that I source in csh.login. This file, defines several environmental variables which my scripts (run by crontab) depend on .

What happened is that I added a new variable the other day, which depended upon a variable yet to be defined (it was defined AFTER the variable I was setting), so the whole thing crashes. I moved my setenv <variable> down a couple lines , and now it all works!

Ryan
 
  


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
apache suddenly stopped working newlinuxnewbie Linux - General 21 11-25-2005 03:56 PM
Sound has stopped working suddenly mrmuckle Linux - General 2 10-15-2005 01:57 PM
Internet suddenly stopped working. figster Linux - Newbie 2 08-29-2005 05:18 PM
yum suddenly stopped working DJOtaku Fedora 3 05-01-2005 11:38 AM
airsnort suddenly stopped working fatrandy13 Linux - Security 1 09-23-2004 08:57 PM


All times are GMT -5. The time now is 04:00 AM.

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