LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 11-21-2005, 10:48 AM   #1
gsrichmo
LQ Newbie
 
Registered: Jun 2005
Posts: 21

Rep: Reputation: 15
cronjob helps


I have a cronjob that is supposed to run daily at 12am. I don't think it is run by crond, because the log says it is run at 1:05 which is when anacron makes sure all the cron jobs got run (65 minutes later). Anyway, /var/log/cron says the job started at 1:05 and gives the command the job was supposed to execute, but the job does not execute. Looks like it is being run as root too. I don't know where to go from here, any ideas? thanks.
 
Old 11-21-2005, 10:50 AM   #2
gsrichmo
LQ Newbie
 
Registered: Jun 2005
Posts: 21

Original Poster
Rep: Reputation: 15
Oh ya, the script is an executable and I do launch it manually with success everyday.
 
Old 11-21-2005, 08:09 PM   #3
ahedler
Member
 
Registered: Oct 2005
Location: A safe distance from Detroit
Distribution: SuSE 10.0, Knoppix
Posts: 99

Rep: Reputation: 17
If you have tested this as a script that runs fine from the command line, you probably need to be aware that cron jobs don't do a login as such, and therefore don't have paths and environment variables set that your script may be expecting. You may need to set variables and paths explicitly, or call utilities and programs with full pathnames.

I expect there's a HOWTO for running cron jobs, but I haven't used it. That may be another resource you'll find helpful.

-Alan
 
Old 11-22-2005, 08:58 AM   #4
gsrichmo
LQ Newbie
 
Registered: Jun 2005
Posts: 21

Original Poster
Rep: Reputation: 15
Thanks for your post. My script does not use any variables. It just gives paths to launch a perl program with certain switches. It used to work until I had to rebuild my stuff on another server. So I don't think the problem is with the script. Any other ideas? anybody?
 
Old 11-25-2005, 09:54 PM   #5
ahedler
Member
 
Registered: Oct 2005
Location: A safe distance from Detroit
Distribution: SuSE 10.0, Knoppix
Posts: 99

Rep: Reputation: 17
Have you tried just creating a simple, do-something-simple cron job just to verify that you are able to run cron jobs at all?

0 10 * * * /usr/bin/date >> /home/me/crontest.log

or something like that to see if it actually does something when you run it. Some systems you are locked out of cron unless specifically allowed. Verify that you are able to run cron first, then see what else may be the problem if it works.

Another thought, if this worked on a different system, is this a different distribution or version? Options may be different, or paths may not be the same; you may need to check if everything is where the job expects to find it, and whether the options are the same on the new system.

-Alan
 
Old 11-27-2005, 01:31 PM   #6
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
Quote:
Originally posted by gsrichmo
Thanks for your post. My script does not use any variables. It just gives paths to launch a perl program with certain switches. It used to work until I had to rebuild my stuff on another server. So I don't think the problem is with the script. Any other ideas? anybody?
Your script may implicitly be using variables (PATH for one). Can you post the script here (within [ code ] tags) so we can take a look?
 
Old 11-28-2005, 02:46 PM   #7
gsrichmo
LQ Newbie
 
Registered: Jun 2005
Posts: 21

Original Poster
Rep: Reputation: 15
the script it is calling is executable, but I just saw that the cronjob is not an executable. I just changed this and will see if it works. if not, will post the script. thanks.
 
Old 11-29-2005, 12:54 PM   #8
gsrichmo
LQ Newbie
 
Registered: Jun 2005
Posts: 21

Original Poster
Rep: Reputation: 15
it worked now. basics first!
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
www helps conm Linux - Software 1 07-08-2005 09:14 PM
Ubuntu helps whiteFang Ubuntu 1 03-31-2005 05:39 PM
Another problem with mouse (on 2.6.11) - nothing helps bendi Slackware 6 03-09-2005 01:36 PM
some helps for slackware 9.0 pls neo_nirvane Slackware 1 04-10-2003 08:24 AM
X-windows helps on mandrake 8.0! newguy2001 Linux - Newbie 0 05-17-2001 11:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:15 PM.

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