LinuxQuestions.org
Help answer threads with 0 replies.
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 09-28-2004, 11:47 PM   #1
Clubber Lang
LQ Newbie
 
Registered: Sep 2004
Location: Seattle, WA
Posts: 6

Rep: Reputation: 0
Cool Crontab "root user" problems...


I have posted this question on the Newbie Forum with no responses, so I thought I would also start a copy here to get wider visability for it:

-------------------------------------------------------

I have a question regarding CRON. I currently have a Windows 2000 system with CYGWIN installed. CRON is working on the system and is able to run basic commands and Shell Scripts. However, I have a semi-large Bash Shell Script that runs several TCL/TK scripts and Windows applications. When I run the Shell Script with CRON I am failing to see any of the output files created by my TCL scripts and Windows Applications. When I run the Shell Script manually from CYGWIN it runs perfect.

Here is the line I have in my CRONTAB:

0 11 * * * . /tmp/NiteBld.sh

After reading other sites, it looks like I might have a problem with the environment variables CRON is using, which differ to what CYGWIN might have setup. Is there a way I can mirror my normal environment variables to CRON?

Also, I have read that I might be running into a file permissions problem. I have CHMOD all of the folders that will have output logs written to, but with no luck.

Please let me know if you would like to view the Shell Script. However, I know that the Shell Script is correct when run manually.

Any information I could get on this would be GREATLY appreciated.

Thanks a bunch,

Clubber Lang

-------------------------------------------------------

PS.

I have been reading through some of the other threads on this forum. My problem seems to be very similar to another one in the Newbie Forum.

In bjdea1's final response he stated the following:

quote:
--------------------------------------------------------------------------------
sorry I found the cause. I have the main config file being accessed as "./config.file". No wonder everything else is failing because this config file is not being read at the very start of the program. Sorry I should have checked this more, thanks for your help.
--------------------------------------------------------------------------------



Since I am new this this, how is he accessing this config file? I do not have a /var/spool/cron directory. When I type the "su" command it reads: "su: user root does not exist". I also do not have a file in the /etc/crond.daily/ directory like wolf2554 mentions. It seems this is a very simple problem. I just don't know how to fix it...
 
Old 09-29-2004, 12:25 PM   #2
sjspig
LQ Newbie
 
Registered: Mar 2003
Distribution: Modded-Knoppix
Posts: 23

Rep: Reputation: 15
If it is an environment issue set up environment variables using the environment name = value syntax in the crontab.

Something like this in the crontab sets up the environment:

ENVVAR=VALUE - sometimes this has to have spaces between the '=' sign on both sides but it depends on the cron implmentation.

Also, are you trying to run a job that is local to your current directory? You must specify the full path of the cron job. I just suggest this as the path to the script looked like:

./tmp/NiteBld.sh to me - the '.' actually looks separate in your post but it looks fishy to me as the . is not a command that I know of so I figured it had something to do with the path.
 
Old 09-29-2004, 07:06 PM   #3
Clubber Lang
LQ Newbie
 
Registered: Sep 2004
Location: Seattle, WA
Posts: 6

Original Poster
Rep: Reputation: 0
Thank you for the response. So if the environement variables I set in NiteBld.sh are:

export ICTSMODE=DEVELOPER
export ICTSMODE=DEVELOPER
export IPMI=1.50
export ICTSSHELL=wish83
export FTFSHELL=$ICTSSHELL
export ICTSROOT=ftf

Do I need to put the 5 cron time values in front of each of the exports (Ex: * * * * *) or just the environment variables as themself? When you launch Cygwin you usually already have lots of environment variables setup up. Do you have to move all of those over manually as well to Cron?

Clubber Lang

P.S. There should have been no space between the . and / in the earlier post. Typo. Sorry about that...
 
Old 09-30-2004, 09:29 AM   #4
sjspig
LQ Newbie
 
Registered: Mar 2003
Distribution: Modded-Knoppix
Posts: 23

Rep: Reputation: 15
The environment variables are on lines by themselves - no time specifications - just "VAR=VALUE" with a possible space required between the var and value. The ./ is problematic because the full path is usually required in order for cron to run the job correctly - even $HOME/command is more likely what you would want there. If the ./tmp folder is local to your user, then you would use something like $HOME/tmp/command...
 
  


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
newbie question: whats the difference between "su root", "su" and "su -&quo mojarron Slackware 9 12-07-2009 04:08 PM
Added a user, now root says "invalid password" gallwapa Linux - Security 20 10-17-2005 04:13 PM
Postgresql error FATAL: user "root" does not exist" cgetty Ubuntu 4 06-21-2005 02:11 PM
User Login Problem: "command not found" unless root! DreameR-X Linux - General 15 12-21-2004 11:27 AM
su wont work, cant "su root" as a normal user lukeorun Linux - General 5 10-17-2002 07:25 AM


All times are GMT -5. The time now is 10:15 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