![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with executing a script scheduled in crontab | Amardeep | Shell Programming and Scripting | 4 | 07-07-2006 12:51 AM |
| CRON problem using script... | Sorrento | Shell Programming and Scripting | 0 | 10-14-2005 12:48 PM |
| problem with a script and the cron | pascalbout | AIX | 1 | 10-13-2005 09:42 AM |
| Conditional File Movement script scheduled using CRON job | imu | Shell Programming and Scripting | 2 | 09-20-2005 06:30 AM |
| cron job problem with csh script | fung_donald | Shell Programming and Scripting | 3 | 04-11-2002 10:15 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
problem when the script is scheduled to run as cron job
Hello,
I have problem in executing a shell script. When the shell script is executed at the shell prompt the script works successfully but when the same script is run as a cron job it fails to execute the files called within the shell script. I have scheduled the job in my crontab file as 15 4 * * * /apps/scripts/scm_tools/validset/poa_product/software_product/spvs > /apps/scripts/scm_tools/logs/software_product_vs.log 2>&1 The spvs file contents are #!/bin/ksh #Set DMDB to specify the Base Database for Dimenisons PDIFF command export DMDB=intermediate/intermediate@PVCS cd /apps/scripts/scm_tools/validset/poa_product/software_product sqlplus intermediate/intermediate @/apps/scripts/scm_tools/validset/poa_product/software_product/spvs "%" # write the initial lines to ptvs.txt to create PDIFF control plan Import file - see Dimenison PDIFF document echo "#PDIFF3" >> spvs.txt echo "#DATE 07-JUL-2007" >> spvs.txt echo "#RESERVED" >> spvs.txt echo "#RESERVED" >> spvs.txt echo "#RESERVED" >> spvs.txt echo "#RESERVED" >> spvs.txt echo "\n" >> spvs.txt nawk -f spvs.awk dpq.csv >> spvs.txt echo "END_OBJECT" >> spvs.txt #PDIFF command to import SOFTWARE_PRODUCT validset values pdiff POA -load_cpl -d -l spvs.log -f spvs.txt #clean up mv *.log archive mv *.txt archive mv *.csv archive The software_product_vs.log file contains /apps/scripts/scm_tools/validset/poa_product/software_product/spvs[19]: sqlplus: not found nawk: can't open file spvs.awk source line number 1 context is >>> <<< /apps/scripts/scm_tools/validset/poa_product/software_product/spvs[45]: pdiff: not found mv: archive not found mv: archive not found mv: cannot access *.csv I am not sure if the problem is because of the child process being created. All the files used have execute permissions on them. Appreciate any suggestions on this. Many Thanks. |
|
||||
|
I suspect that it couldn't recognize the sqlplus and the pdiff command in the script.
So check if you have declared the environmental variables like ORACLE_HOME and PATH. If not then export these variables in your script. Hope this helps. |
|
||||
|
matrixmadhan,
Thanks for your help. Can you please tell me what would be the knock on effect of sourcing a .profile file At the moment I am using my sqlplus as sqlplus intermediate/intermediate @/apps/scripts/scm_tools/validset/tstcm_product/software_product/spvs "%" Let me know if i am not using the full path as told by you. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|