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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-21-2005, 10:48 AM
|
#1
|
LQ Newbie
Registered: Jun 2005
Posts: 21
Rep:
|
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.
|
|
|
11-21-2005, 10:50 AM
|
#2
|
LQ Newbie
Registered: Jun 2005
Posts: 21
Original Poster
Rep:
|
Oh ya, the script is an executable and I do launch it manually with success everyday.
|
|
|
11-21-2005, 08:09 PM
|
#3
|
Member
Registered: Oct 2005
Location: A safe distance from Detroit
Distribution: SuSE 10.0, Knoppix
Posts: 99
Rep:
|
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
|
|
|
11-22-2005, 08:58 AM
|
#4
|
LQ Newbie
Registered: Jun 2005
Posts: 21
Original Poster
Rep:
|
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?
|
|
|
11-25-2005, 09:54 PM
|
#5
|
Member
Registered: Oct 2005
Location: A safe distance from Detroit
Distribution: SuSE 10.0, Knoppix
Posts: 99
Rep:
|
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
|
|
|
11-27-2005, 01:31 PM
|
#6
|
Member
Registered: May 2005
Posts: 378
Rep:
|
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?
|
|
|
11-28-2005, 02:46 PM
|
#7
|
LQ Newbie
Registered: Jun 2005
Posts: 21
Original Poster
Rep:
|
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.
|
|
|
11-29-2005, 12:54 PM
|
#8
|
LQ Newbie
Registered: Jun 2005
Posts: 21
Original Poster
Rep:
|
it worked now. basics first!
|
|
|
All times are GMT -5. The time now is 02:01 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|