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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
K shell with Oracle vijaykrc Shell Programming and Scripting 0 01-14-2008 03:04 PM
using Oracle with Cron alikun Shell Programming and Scripting 4 04-24-2007 03:37 PM
Having A Problem Connecting to Oracle Using Cron goodmis UNIX for Dummies Questions & Answers 1 03-20-2007 04:12 PM
Shell Scripting with Oracle... B14speedfreak Shell Programming and Scripting 2 03-22-2006 12:04 PM
ORACLE from Shell scripts mohanprabu Shell Programming and Scripting 2 11-24-2004 12:11 AM

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 04-07-2005
pathanjalireddy pathanjalireddy is offline
Registered User
  
 

Join Date: Apr 2005
Posts: 21
Lightbulb Shell + Oracle + Cron job

#!/bin/sh
sqlplus -s scott/tiger <<!

update Parking
set wheels = 4
where vehicle = 'car' ;

select * from Parking;
!

This is the script I had written for updating a table called "Parking". It executes properly when I run it from the command line. But , when I try to do the same thing as a cronjob it just tells me that "sqlplus not found"

syntax that I gave in the cron file:
50 01 07 04 04 /personal/users/sa/Mani44.sh > /personal/users/sa/tot.txt 2>&1

I saved the script in the file Mani44.sh

Please help me out
  #2 (permalink)  
Old 04-07-2005
bhargav's Avatar
bhargav bhargav is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2004
Location: USA
Posts: 511
Question:

Are you running the cron with same login id.?

It seems environment is not set properly in the cron script.

export all the necessary env variables such as PATH to run the script successfully as cron.
OR
If environment is set in user1's .profile set the cron as follows.
Code:
50 01 07 04 04 su -c user1 "/personal/users/sa/Mani44.sh "> /personal/users/sa/tot.txt 2>&1

for more help

man su
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 08:41 AM.


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