Problem with executing a script scheduled in crontab


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem with executing a script scheduled in crontab
# 1  
Old 07-03-2006
Problem with executing a script scheduled in crontab

Hi

I have written a shell script(in Solaris) in which following logic is there.....

i=1
while read control
do
key[$i]=`echo $control | awk -F$DELIMITOR '{ print $1 }'`
echo "Key Values" ${key[i]}
i=`/usr/bin/expr $i + 1`
done < $CONFPATH/$CONFFILE

when i execute it at prompt it works fine...but when the same is scheduled in crontab it is giving errors like
/user1/asdf/source_code/listen_sch.sh: key[1]=PortNumber: not found
/user1/asdf/source_code/listen_sch.sh: bad substitution
/user1/asdf/source_code/listen_sch.sh: val[1]=2001: not found


any suggestions.....
Thanks
# 2  
Old 07-03-2006
Try adding this as the first line in your script:

Code:
#!/usr/bin/ksh

Regards.
# 3  
Old 07-03-2006
I am facing similar problem, tried but the solution didn't work. Pl help
# 4  
Old 07-03-2006
hi Amardeep

Have u checked for permissions of scripts.....
and which sheel u are working in can u send the o/p u get while running script without crontab........
thks
Aparna
# 5  
Old 07-07-2006
oye kudiye chal gia Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script when scheduled in Crontab gives extra records in output

Hi, We have created a script that's checks the latency of IIDR subscription by fetching details from a config file (that contains subscription details) and running the CHCCLP command. The out put is then concatenated in a csv file. Once all subscription details are saved the script send a mail... (7 Replies)
Discussion started by: ab095
7 Replies

2. UNIX for Beginners Questions & Answers

Script gives error when scheduled in crontab

i have written one script which is working fine when i run it manually but giving error when i schedule it in crontab. cat SUMMARY.sh #!/bin/bash DT1=`date +%Y%m%d` echo "Off PP TT" >>summary_$DT1.txt cat ues1.txt_$DT1 >>summary_$DT1.txt cat ues2.txt_$DT1... (2 Replies)
Discussion started by: scriptor
2 Replies

3. Shell Programming and Scripting

Log file is not updating when I run shell scripts scheduled thru crontab

Hi Forum, Good Day! I have created an empty html file wtih permissoin 777 created shell script(with permission 777) , code is below. #=======================start============== . /data09/oracle/apps_st/appl/D_oraapp095.env rm -rf /home/mnp/Test_log.txt echo... (1 Reply)
Discussion started by: kartheekbk
1 Replies

4. Shell Programming and Scripting

Scheduled job not running automatically in crontab

i have a job scheduled in crontab. The problem is, it is not running automatically as per the time scheduled. But runs when executed manually. What would be the problem? Help me with this please. (6 Replies)
Discussion started by: Santhosh CJ
6 Replies

5. Red Hat

Script not working if crontab scheduled

Hi all, I'm working to a script with /bin/bash shebang. The script works perfectly if I run from command line. The script runs under a non root user and inside the commands are set with sudo command in a such a way they can be run under root, for example (first rows of the script):... (5 Replies)
Discussion started by: idro
5 Replies

6. UNIX for Dummies Questions & Answers

crontab scheduled details required

Hi, I have the below job scheduled in crontab. Can you please tell me at what interval this job is scheduled? Where is the name of the job defined here? I will definitely go through the UNIX documentation a little later, for the time being, please provide me few details on this. Thank you. ... (0 Replies)
Discussion started by: Dev_Dev
0 Replies

7. Windows & DOS: Issues & Discussions

Hide svchost.exe (dos prompt) when executing scheduled task

hello everyone. I created a java program that will pop up a dialog, and scheduled it as a task. Everything works fine except when the scheduled java program runs and the dialog pops up, there is another dos prompt (svchost.exe) hanging behind the dialog box and doesn't go anywhere until the java... (0 Replies)
Discussion started by: milhan
0 Replies

8. UNIX for Dummies Questions & Answers

probs executing crontab script

Hi everyone In an existing crontab script for the root user, I've added 5 new lines of code, however for some unknown reason, these lines of code were not executed. Here is what I did 30 0 * * * ./usr/people/atlab/jamesgoh/disk_reader/disk_reporter /picnic 30 0 * * *... (6 Replies)
Discussion started by: JamesGoh
6 Replies

9. Shell Programming and Scripting

Script not executing in CRONTAB

Hi, I have written a script for file scan : #!/bin/sh find . -name "common.log.diff" > /dev/null 2>&1 if ; then cp common.log common.log.diff diff common.log common.log.diff > DIFFERENCE.log cp common.log common.log.diff grep "ERROR" DIFFERENCE.log if ; then echo "1" >... (6 Replies)
Discussion started by: himvat
6 Replies

10. UNIX for Dummies Questions & Answers

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 ... (6 Replies)
Discussion started by: forumthreads
6 Replies
Login or Register to Ask a Question