The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem with crontab cleansing_flame UNIX for Dummies Questions & Answers 1 01-29-2008 04:02 PM
Problem with crontab cleansing_flame UNIX for Dummies Questions & Answers 3 01-14-2008 12:03 PM
Crontab problem jess_t03 AIX 2 01-03-2008 03:29 AM
Problem with Crontab Zak UNIX for Dummies Questions & Answers 2 12-20-2005 01:44 AM
crontab problem DebianJ UNIX for Advanced & Expert Users 10 06-04-2005 12:36 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-31-2003
Registered User
 

Join Date: Oct 2003
Posts: 2
Stumble this Post!
Problem with crontab

Hi guys!
I have a problem with my crontab. I made a script named expsa.sh, but I can not execute it on crontab:

00 11 * * * /sa/expsa.sh

The strange thing is that i can do it by using `at `:

at -m 1100
at> /sa/expsa.sh

it works!
What can i do for doing the first one?
Thanks. By
Forum Sponsor
  #2 (permalink)  
Old 10-31-2003
oombera's Avatar
Have a day :|
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
Stumble this Post!
Just a couple ideas til someone with more knowledge of crontab helps you:

- is the "sa" directory located in root? Or is it actually something like /usr/local/sa/expsa.sh, for example?

- are the permissions correct on the file?

- are you receiving any sort of errors on screen, in a logfile, etc. How do you know it's not running, but just not producing any output?
  #3 (permalink)  
Old 10-31-2003
Registered User
 

Join Date: Oct 2003
Posts: 2
Stumble this Post!
Sorry

I forgot write about errors.

Yes, sa is in root.
It shows an error: expsa.sh: exp: not found
  #4 (permalink)  
Old 10-31-2003
oombera's Avatar
Have a day :|
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
Stumble this Post!
The only thing I could find on that error was an old post in the IT Resource Center forums, and it looks like the only solution they came up with was that the OP should be using an absolute pathname instead of a relative one (e.g. /usr/local/someFile rather than just someFile), so I'm not sure what's wrong with the way you have it...
  #5 (permalink)  
Old 10-31-2003
flim flam flamma jamma
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
Stumble this Post!
crons PATH env variable can be set in /etc/default/cron on solaris.

if you dont want to use absolute paths in your script, makesure you specify the PATH env variable in yoru script befor you run any commands.
  #6 (permalink)  
Old 10-31-2003
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,444
Stumble this Post!
From at(1)
Quote:
The first part sets up the environment to match the environment when the at or batch command was issued. This includes the current shell environment variables, current directory, umask, and ulimit.
And from crontab(1)
Quote:
cron supplies a default environment for every shell, defining:

HOME=user's-home-directory
LOGNAME=user's-login-id
PATH=/usr/bin:/usr/sbin:.
SHELL=/usr/bin/sh
Set your environment to match what cron will give you and then submit the at job. It will fail then.

Scripts that run from cron should not depend on the environment.
Google The UNIX and Linux Forums
Closed Thread

Tags
solaris

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:14 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0