Unix/Linux Go Back    


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

crontab issue

HP-UX


Tags
export display

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 01-22-2008   -   Original Discussion by vaddi
vaddi's Unix or Linux Image
vaddi vaddi is offline
Registered User
 
Join Date: Jan 2008
Last Activity: 27 March 2008, 9:37 AM EDT
Location: bangalore
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Power crontab issue

Dear Folks,

i am new to hp-ux, i have a problem scheduling the crontab,
The script is working fine at command prompt, but not working at cron, please find a solution for it ,

here are the logs and my schedule at cron:
log after restarting crontab /var/adm/cron/log
! *** cron started *** pid = 24393 Thu Jan 3 12:33:16 IST 2008
> CMD: /home/oracle/fullexp.sh >> /home/oracle/run.log
> oracle 24481 c Thu Jan 3 12:35:00 IST 2008
< oracle 24481 c Thu Jan 3 12:35:00 IST 2008 rc=1
~
~
~
~
~
######################################################

#!/usr/bin/sh
export EDITOR=vi
export ORACLE_SID=mibast
export ORACLE_BASE=/home/oracle/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export DISPLAY=10.1.9.21:0:0
PATH=$ORACLE_HOME/bin:$PATH
export PATH
export SHELL=usr/bin/bash
/home/oracle/oracle/product/10.2.0/db_1/bin/exp system/manager file='/data3/expo
rt/full_26.dmp' log='/data3/export/full_26.log' full=y consistent=y buffer=99999
99 statistics=none

But still no luck, please find the solution.
Sponsored Links
    #2  
Old Unix and Linux 01-22-2008   -   Original Discussion by vaddi
ennstate's Unix or Linux Image
ennstate ennstate is offline
Registered User
 
Join Date: Mar 2007
Last Activity: 1 January 2015, 1:39 PM EST
Location: Stockholm
Posts: 230
Thanks: 1
Thanked 4 Times in 4 Posts
What is the error message that you got?

Thanks
Nagarajan G
Sponsored Links
    #3  
Old Unix and Linux 01-22-2008   -   Original Discussion by vaddi
Perderabo's Unix or Linux Image
Perderabo Perderabo is offline Forum Advisor  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 26 February 2016, 12:31 PM EST
Location: Ashburn, Virginia
Posts: 9,930
Thanks: 64
Thanked 471 Times in 271 Posts
Quote:
Originally Posted by vaddi View Post
export SHELL=usr/bin/bash
You can't make SHELL a relative path.
export SHELL=/usr/bin/bash
might make sense if bash is really in /usr/bin. This needs to the the absolute path to a shell.
    #4  
Old Unix and Linux 01-22-2008   -   Original Discussion by vaddi
1jnike's Unix or Linux Image
1jnike 1jnike is offline
Registered User
 
Join Date: May 2006
Last Activity: 5 December 2010, 1:07 AM EST
Location: UK
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Java

Hi vaddi,

I have just released that your absolute path in your crontab entry should read, I think;

> CMD: /home/oracle/oracle/fullexp.sh >> /home/oracle/run.log

your entry

> CMD: /home/oracle/fullexp.sh >> /home/oracle/run.log

See Below

#!/usr/bin/sh
export EDITOR=vi
export ORACLE_SID=mibast
export ORACLE_BASE=/home/oracle/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export DISPLAY=10.1.9.21:0:0
PATH=$ORACLE_HOME/bin:$PATH
export PATH
export SHELL=usr/bin/bash
/home/oracle/oracle/product/10.2.0/db_1/bin/exp system/manager file='/data3/expo
rt/full_26.dmp' log='/data3/export/full_26.log' full=y consistent=y buffer=99999
99 statistics=none

I hope this is of help


Jnike
Sponsored Links
    #5  
Old Unix and Linux 01-22-2008   -   Original Discussion by vaddi
vbe's Unix or Linux Image
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 13 December 2017, 2:58 PM EST
Location: Switzerland - GE
Posts: 6,491
Thanks: 296
Thanked 555 Times in 517 Posts
If its working fine at command prompt and not in the batch mode, then your issue is about your environment...
For instance PATH=<something>:$PATH is equal to PATH=<something>:/usr/bin... So be sure to export the PATH to all your called binaries...
No variables are set except the ones you specify...
Put all your needed variables in a file and execute it :
. /absolutePathTo/loadmyvars
then execute your script!
So this is what we should see in your Newscript for batch:
#!/usr/bin/ksh #or whatever
. /absolutePathTo/loadmyvars
myolscriptthatdidntwork
exit

If you want to check, just put in a script
. /to-oraclehome/.profile
script

It should work..


Good luck
Vic
Sponsored Links
    #6  
Old Unix and Linux 01-24-2008   -   Original Discussion by vaddi
vaddi's Unix or Linux Image
vaddi vaddi is offline
Registered User
 
Join Date: Jan 2008
Last Activity: 27 March 2008, 9:37 AM EDT
Location: bangalore
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Data

Dear Nagarajan ,

the log is not being generated so nothing to see
Sponsored Links
    #7  
Old Unix and Linux 01-24-2008   -   Original Discussion by vaddi
vaddi's Unix or Linux Image
vaddi vaddi is offline
Registered User
 
Join Date: Jan 2008
Last Activity: 27 March 2008, 9:37 AM EDT
Location: bangalore
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
MySQL

Dear Folks,

Thanks for ur reply,

here is the environment variables , please go through it and get me the right solution for the script.Linux


env variables(oracle)

$ env | grep ORACLE
ORACLE_BASE=/home/oracle/oracle
ORACLE_SID=mibast
ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1
$ env | grep oracle
PATH=/home/oracle/oracle/product/10.2.0/db_1/bin:/usr/bin:/opt/ansic/bin:/usr/cc
s/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/
fcms/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/pd/bin:/opt/wbem/bin:/opt/wbem/s
bin:/opt/resmon/bin:/opt/firefox:/opt/gnome/bin:/opt/mozilla:/opt/graphics/commo
n/bin:/opt/hpsmh/bin:/opt/perl_32/bin:/opt/perl_64/bin:/usr/sbin/diag/contrib:/o
pt/sfm/bin:/opt/ssh/bin:/opt/thunderbird:/opt/gwlm/bin:/opt/aCC/bin:/opt/cadvise
/bin:/opt/langtools/bin:/opt/imake/bin:.
ORACLE_BASE=/home/oracle/oracle
LOGNAME=oracle
HOME=/home/oracle
LD_LIBRARY_PATH=/home/oracle/oracle/product/10.2.0/db_1/lib
ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1
$
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Crontab Issue..!!! gayisada UNIX for Dummies Questions & Answers 1 05-02-2011 06:55 AM
Crontab issue h@foorsa.biz AIX 3 05-02-2011 04:55 AM
Issue with crontab Sriranga Shell Programming and Scripting 12 06-24-2010 10:19 AM
crontab issue crackthehit007 UNIX for Advanced & Expert Users 4 03-23-2009 12:32 AM
crontab issue Semper_Tempus Solaris 6 07-19-2005 11:13 PM



All times are GMT -4. The time now is 04:09 AM.