help help cronjob problem with script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help help cronjob problem with script
# 1  
Old 02-09-2007
help help cronjob problem with script

hi all,

have no experience with cronjob at solaris,
i have create script like below:

#!/bin/sh

DAY=`/export/home/oracle/bin/lastdate | nawk '{print $1}'`

/export/home/orahome/bin/sqlplus -s abc/abc<<eof
set heading off;
set linesize 100;
set feedback off;

spool /export/home/temip/$DAY.log

select ip,host_id from omc_ip ;

spool off;

EXIT;
eof

sed '/^$/d' /export/home/temip/$DAY.log > /export/home/temip/host$DAY
rm -rf /export/home/temip/$DAY.log

let's say the filename is "abc.sh"

the file i put in the oracle user environment but i have change the owner to user abc that i want to execute the file from cronjob.

the problem is the cronjob cannot running properly if i run manually from the abc user environment i got this error messages:

Message file sp1<lang>.msb not found
Error 6 initializing SQL*Plus

please advices

how to fix it?

thank you so much

Regards,

bucci
# 2  
Old 02-09-2007
It seems more like Oracle error try connecting to oracle manually.
# 3  
Old 02-09-2007
Make sure the necessary Oracle environment variables are part of your script.

Variables like:
ORACLE_HOME
ORAENV
ORACLE_SID
LD_LIBRARY_PATH

Which ones needed in this particular case I cannot tell.
# 4  
Old 02-10-2007
I believe the error is due to - unable to locate the message property file. As said by others it should most probably be solved by the ORACLE specific ENV variables.

If not you need to export to the env through the script that is run
# 5  
Old 02-10-2007
hi sb008,

the script is running in other user environment lets say user "abc". i have try to put oracle variable but cannot run.

please advices

thank you

Regards,

bucci

Quote:
Originally Posted by sb008
Make sure the necessary Oracle environment variables are part of your script.

Variables like:
ORACLE_HOME
ORAENV
ORACLE_SID
LD_LIBRARY_PATH

Which ones needed in this particular case I cannot tell.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Linux script for several cronjob

I have a linux server for my joomla website. I am importing xml feeds (around 200). The component give a tool which list all the cron job commands to automaticaly make the feeds import I don't want to add one by one each cron job. So my idea is to make one cron job which will call a shell... (0 Replies)
Discussion started by: nino59
0 Replies

2. Shell Programming and Scripting

Shell script with cronjob

Hello All, I have a script which will cd into a directory based on current timestamp. It will then do a grep and search for a condition. It's run on a cron job that runs every 30 minutes. So if it finds a match in 00, it sends out the contents of that grep to an alert and emails out. Now... (3 Replies)
Discussion started by: liketheshell
3 Replies

3. UNIX for Advanced & Expert Users

UI accessiblity problem when using cronjob for server restart

Hi, I have a couch Db server running. I have written a script which will check and kill the multiple instances of the same and then start again a new one. Now when i start the db server manually, the UI of the DB is accessible via browser. But when i do the same using cronjob, the UI of... (0 Replies)
Discussion started by: sarath@123
0 Replies

4. UNIX for Dummies Questions & Answers

Script not running through Cronjob

Hi, I have a .ksh script which updates the database. The script is running fine manually but it is not running through cron.All the file permissions are fine. The script contents are as below: #!/usr/bin/ksh ddate=`date +%Y%m%d` echo $ddate nohup sqlplus crm/crm @db_state_sync.sql >>... (3 Replies)
Discussion started by: shivangi
3 Replies

5. UNIX for Dummies Questions & Answers

how to cancel a cronjob if the cronjob still running

hi everyone I'm newbie in this forum hope I can get some help here :) I have a command in crontab that executed every 1 minute sometime this command need more than 1 minute to finish the problem is, the crontab execute this command although it's not finish processing yet and causing the system... (7 Replies)
Discussion started by: 2j4h
7 Replies

6. Solaris

Creating a CronJob Script

Hi All, Good Day. Anyone can guide me on how to create a cronjob script that run prstat -a and vmstat 10 10 on the certain time of the day and produce a log which will be kept in a specific directory? I am running on Solaris 10. Thanks. (2 Replies)
Discussion started by: ronny_nch
2 Replies

7. Shell Programming and Scripting

cronjob inside the script

Hiii, can nayone provide me the sample script which can do the following tasks--- I will apperciate if anyone give me their valuable inputs.I guess this is not at all a big task for the experts in the forum so kindly help me out in this. (3 Replies)
Discussion started by: namishtiwari
3 Replies

8. Shell Programming and Scripting

Shell script not running thru Cronjob

Hi I have a shell script, it run ok if executed from the path it is located at but doesnot run when the same is tried through cron-job. can someone help me please. regards gaurav shrinivas Email address removed (8 Replies)
Discussion started by: gauravshrinivas
8 Replies

9. Shell Programming and Scripting

Problem with cronjob...

Hi All I want to run a script every half an hour everyday, but it looks like it is not working the way it is supposed to. I use the line 0,30 * * * * ksh /...<script> But it only runs every hour at 30 minutes. Am i doing something wrong ? I use AIX 5.1 as my OS. Thanks In... (1 Reply)
Discussion started by: kswaraj
1 Replies

10. Shell Programming and Scripting

ping cronjob problem

Hi all, I'm trying to write a shell script that will ping a site and and write the date and 1 or 0 (for success or no success) to a file. it looks roughly like this: #/bin/sh set mydate = `date` set myvar = `ping -c 1 hostname | grep -c "100%"` if ($myvar == 1) then echo... (1 Reply)
Discussion started by: TylerDurden
1 Replies
Login or Register to Ask a Question