Execution of Unix script after every second without crontab


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Execution of Unix script after every second without crontab
# 1  
Old 10-06-2011
Execution of Unix script after every second without crontab

Hi,

I have shell script "A" which is executing oracle pl/sql procedure and initiate its multiple threads at a time as below on given user value in an other script "B".

I want to execute script "A" after every second with out cron tab as " A " will keep on executing after every second till oracle procedure in any cycle return some value [eg "1" which is returned from oracle procedure]

Script "B"
Code:
#!/bin/bash
# Run script: ./scriptname value
UserValue=$1

do
  # start threads
  for i in $(seq 1 $UserValue)
  do
    echo "started instance no: $i"
    # /path/to/script/A &
  done

code of script "A"
Code:
#!/bin/sh
#sleep 10
    typeset argv=$#
    typeset argc=$*
  
ORACLE_HOME=/oracle/home/product/10.2.0/db_1
PATH=/usr/local/bin:$ORACLE_HOME/bin:$PATH
export PATH
sqlplus -s sip/sipdev@sipdev<<THEEND



DECLARE
accountId varchar2(100);
result varchar2(100);
error varchar2(100);
begin
accountId:=1225;


TEST_DISPLAY2('$inAccountNo',result,error);


commit;
end;
/
QUIT;
THEEND



Need your kind assistance.


Moderator's Comments:
Mod Comment Video tutorial on how to use code tags in The UNIX and Linux Forums.

Last edited by Franklin52; 10-06-2011 at 07:32 AM.. Reason: Please use code tags, thank you
# 2  
Old 10-06-2011
Make script C and have it like this

Code:
#!/bin/bash
 
while true
do
   ./scriptA
   sleep 1
done

--ahamed
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Crontab Execution

Hi Guys, I need help to clear my doubt w.r.t Crontab execution. uname -a HP-UX myservername B.11.31 U ia64 1422528451 unlimited-user licenseI created a crontab entry to execute particular job on Saturday 11/15/2014 11:22 Below is the cron entry #refresh DEVDB from PRODDB 22 11 15 11 6... (6 Replies)
Discussion started by: rocky.community
6 Replies

2. UNIX for Dummies Questions & Answers

Execution Problems with Crontab

Dear Folks, I have written a shell script which internally connects to oracle database through sqplplus command line. The script runs fine when run manually. Now I am scheduling it to run (Linux environment) from crontab. In crontab it is failing with an error: sqlplus command... (6 Replies)
Discussion started by: tamojitc
6 Replies

3. Shell Programming and Scripting

Problem with Job execution using crontab

Hi All, I am facing a problem with crontab.I made an entry in crontab like this 05 07 * * * /afs2/cdwfullacc/current/exe/cdw_generate_special_klant.sh > /afs2/cdwfullacc/current/scratch/cdw_gen_cron.log But job was not getting executed. Entry in crontab was made with same user by whom... (4 Replies)
Discussion started by: krishna_gnv
4 Replies

4. UNIX for Dummies Questions & Answers

Problem with Crontab execution

Hi I have shell script to excute the SQL script.And i have scheduled those shell script in crontab.But the Shell script is not running timely and i got the below error Crontab entry 15 05 17 7 * /export/home/vcpsapp/vcps/stat.sh Output Your "cron" job on uspxivus16... (3 Replies)
Discussion started by: mak_boop
3 Replies

5. Shell Programming and Scripting

unix script for conditional execution

Below is my shell script. I am trying to execute two different BTEQ scripts depending on the day of the week. So on a saturday I will execute a certain BTEQ script and on other weekdays I will run the other script. #!/bin/ksh dt=`date +"%a"` if then bteq > final_output <<- EOF .run... (3 Replies)
Discussion started by: Mihirjani
3 Replies

6. UNIX for Dummies Questions & Answers

Unscheduled crontab execution

Hi All, Do apologise, for it has been a long while since I was last on the forum. I've been doing documentation and primiarily Windows efforts for some while now. :( We are running a HP-UX 11.23 unit. This morning two separate crontab users executed shutdown scripts of their respective... (14 Replies)
Discussion started by: Cameron
14 Replies

7. UNIX for Dummies Questions & Answers

Execution problems with crontab

I need your help please Inin a production system i found crontab entries was removed because i typed crontab -l with username corasc and didn't show anything. i asked the administrador to restored the mentioned crontab, he restored the crontab: The problem is when restored the crontab file is... (2 Replies)
Discussion started by: alexcol
2 Replies

8. Shell Programming and Scripting

crontab execution

is it possible to soecify time overnight in 5 days for example: 0 18-7 * * 1-5 /mycode is this okay to use 18-7 because im not getting the results correctly? (4 Replies)
Discussion started by: vadharah
4 Replies

9. Solaris

Unix script Problem with crontab

Hi Experts, Am facing some problems with script (Sun solaris 9). My script (sqlplus.sh)looks like this. . . ............................................... set 'date' dd=$3 export dd mon=$2 export mon yyyy=$6 export yyyy cd /oracle/P47/saparch... (8 Replies)
Discussion started by: vrjalli
8 Replies

10. UNIX for Advanced & Expert Users

Unix script execution messages

Hi folks, Is there a way to view the messages, during execution of a unix script?, for the purpose of debugging. Regards (2 Replies)
Discussion started by: JimJim
2 Replies
Login or Register to Ask a Question