Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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.
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.
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.
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.