The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Cron not running garric UNIX for Advanced & Expert Users 6 04-11-2008 08:32 AM
Cron not running .. please help beisaikong Shell Programming and Scripting 2 07-12-2007 07:05 AM
cron job is not running Suguna UNIX for Advanced & Expert Users 3 09-28-2006 09:11 AM
Cron Job Not Running nag_sundaram HP-UX 1 10-17-2005 10:38 AM
running cron jobs ted Shell Programming and Scripting 1 05-19-2004 12:35 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-10-2003
ajnabi ajnabi is offline
Registered User
  
 

Join Date: Nov 2001
Location: Atlanta, GA
Posts: 34
not running in cron

I have written a shell script and when i run it from shell prompt it runs fine but in the cron it only runs partially.
That means cron is working fine.
there is a command which i am using in the script which doesn't run at all.
That comman uses different user privileges like ptadmin
i am not sure how to make this work.
What I am thinking is that particular comman exports the database from oracle and it take 20-25 min to execute it while i run manually. but in the cron it looks like it doesn't even try it.
Although i have checked the log file and cron is creating log file so its executing but.
Any thoughts fellows.

tx
  #2 (permalink)  
Old 07-10-2003
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Check your environment differences between command line and cron.

$ env > /tmp/mycommandline.env

and add that command to your script
env > /tmp/mycron.env

Then check that you are giving the full path to commands in your script.

Read the man page on cron, crontab for further information such as:

The shell is invoked from your $HOME directory with an arg0
of sh. Users who desire to have their .profile executed must
explicitly do so in the crontab file.
  #3 (permalink)  
Old 07-11-2003
Optimus_P Optimus_P is offline Forum Advisor  
flim flam flamma jamma
  
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
you could always just source your .profile or what ever into your script.

at the top of the script do a . ./.your_profile_goes_here
  #4 (permalink)  
Old 07-11-2003
ajnabi ajnabi is offline
Registered User
  
 

Join Date: Nov 2001
Location: Atlanta, GA
Posts: 34
thanks fellows..
I have added my commandline enviornment to my script ..
it didn't work but later on i changed my shell to k shell and it worked like piece of cake.
In ksh after my enviornment variable i used export.
e.g.
PATH=/usr/abc:/usr/bcd; export PATH;
..

does somebody know how to do the same in csh & bourne shell.

Thanks again
  #5 (permalink)  
Old 07-11-2003
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
sh would use the same command as ksh - csh would be

% setenv PATH /usr/abc:/usr/bcd

For csh, you would put this in the .login file, not the .profile.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0