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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Crontabs and Oracle

RE: Crontabs and Oracle

From: Rao, Maheswara <Maheswara.Rao_at_Sungardp3.com>
Date: Fri, 30 Nov 2001 07:19:47 -0800
Message-ID: <F001.003D1DEB.20011130070717@fatcity.com>

Tim,

Sourcing a .profile within cron jobs is not a good way doing a shell scripting. One big reason --- A .profile might contain a lot of functions which are OK if you are loggin in with that specific user id. And those functions might be doing some job that might affect the cron job.

In my opinion, the correct way is to export the required variables or setting them in the beginning of the cron job.

Rao

-----Original Message-----
Sent: Friday, November 30, 2001 5:35 AM
To: Multiple recipients of list ORACLE-L

On Thu, Nov 29, 2001 at 11:15:43AM -0800, Jared.Still_at_radisys.com wrote:
>
> I've seen a number of suggestions for sourcing .profile
> in the cron jobs, but this is not always a good idea, as
> .profile often contains script that will not execute when
> not attached to a tty.

I think sourcing .profile is the 'right' thing to do.

If that breaks then the .profile needs fixing as it'll probably also break things like rsh/rcp etc.

I've seen both these code sytles used (for sh/ksh/bash etc):

    if [ "$PS1" ]
    then

            ... interactive stuff here ...     fi

or

    case $- in
    *i*)

            ... commands for an interactive shell here ...
            ;;
    *)      ;;

    esac

Tim.

-- 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rao, Maheswara
  INET: Maheswara.Rao_at_Sungardp3.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Nov 30 2001 - 09:19:47 CST

Original text of this message

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