Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Cron scripts

Re: Cron scripts

From: John Higgins <JH33378_at_deere.com>
Date: Sat, 12 Jun 1999 10:02:19 -0500
Message-ID: <3762767B.D26B4DD8@deere.com>


When cron executes a script, the environment is not the same as when you execute the same script from the command line. This can trip you in strange and mysterious ways. For example, the working directory set by cron is not your default directory. If part of your script creates a relative file name into the current working directory) and another part of your script uses an absolute file name (full ppath), then your script depends on being executed in the correct working directory.

I try to remember to fully re-establish my environment in cron scripts. When I have forgotton, strange things have happened!

Brian Peasland wrote:

> I've been trying to create a script which I'll be executing through cron.
> When I run the script, everything works just fine. When I schedule the
> script through crontab, it doesn't work. And I can't see what the cron
> script is doing. Any ideas how to find out the "output" from the run of a
> cron script?
>
> Here's what I'm trying to do:
> in a script,
> change SID
> sqlplus userid @script < passwordfile
> mail results
> do again for another SID
>
> The script contains a spool command to spool the results of the script to a
> file. That file is sent to my email account. When I run this script through
> the command line, it works just fine. When I run it through crontab, the
> spool file is empty and I get mailed nothing. Any ideas?
>
> Thanks in advance,
> Brian Peasland
> peasland_at_msn.com
Received on Sat Jun 12 1999 - 10:02:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US