Home Man
Search
Today's Posts
Register

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

crontab issue

Tags
cron, crontab, export display, hp-ux, issue

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 01-22-2008
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.
# 2  
Old 01-22-2008
What is the error message that you got?

Thanks
Nagarajan G
# 3  
Old 01-22-2008
Quote:
Originally Posted by vaddi
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 01-22-2008
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
# 5  
Old 01-22-2008
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
# 6  
Old 01-24-2008
Data

Dear Nagarajan ,

the log is not being generated so nothing to see
# 7  
Old 01-24-2008
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.


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
$
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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


All times are GMT -4. The time now is 06:37 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password