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
~
~
~
~
~
######################################################
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.
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
i have changed the cron entry but no luck, the log is not getting generated.
I can find this message in /var/adm/cron/log
> CMD: /home/oracle/oracle/product/10.2.0/db_1/fullexp.ksh 1>/tmp/log.txt 2>&1
> oracle 20813 c Thu Jan 24 16:32:00 IST 2008
< oracle 20813 c Thu Jan 24 16:32:00 IST 2008 rc=1
>export SHELL=usr/bin/ksh
This line has nothing to do in your script since you have decided to use the ksh shell (your first line is calling it..) especially when wrong! -> Where is the slash in front of usr?