From Maheswara.Rao@Sungardp3.com Fri, 30 Nov 2001 12:14:27 -0800 From: "Rao, Maheswara" Date: Fri, 30 Nov 2001 12:14:27 -0800 Subject: RE: Crontabs and Oracle Message-ID: MIME-Version: 1.0 Content-Type: text/plain Good idea. Rao -----Original Message----- Sent: Friday, November 30, 2001 12:52 PM To: Multiple recipients of list ORACLE-L What I did is create a file that sets the environment for each database. This file is sourced in my profile as well as any script I create. Therefore, when it comes time to put a script in cron I do nothing but place it in there. Plus, that gives me one spot I ever have to change when I upgrade. This file takes the database sid as a parameter. -----Original Message----- Maheswara Sent: Friday, November 30, 2001 7:07 AM To: Multiple recipients of list ORACLE-L 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@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@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@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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kimberly Smith INET: ksmith2@myfirstlink.net 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@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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rao, Maheswara INET: Maheswara.Rao@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@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).