Multiple Process issue


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Multiple Process issue
# 1  
Old 07-09-2008
Question Multiple Process issue

Hello all,

First of all, I want to thank the forum for being so helpful to me in many occasions. I have searched through the forums and the internet. I couldnt find a perfect solution for my issue. Here is what Im trying to do..

Im verifying a bunch of jobs whether they are completed or not and start the next set. We have two sets of jobs one is LongRunning(LR) and the other SR jobs. The SR jobs are in sets of 7 and the LR are by themselves. We have to start the next set of jobs after completion of the first set.. For ex..

LR1 Job1
LR2 Job2
SR1 Job3
SR1 Job4
SR1 Job5
SR1 Job6
SR1 Job7
SR1 Job8
SR1 Job9
LR3 Job10
LR4 Job11
SR2 Job12
SR2 Job13
SR2 ....

LR1, LR2 and SR1 starts simultaneously. I need to check for LR1 completion to start the LR3 and LR2's completion to start LR4. But on the other hand, I have to wait for all the SR1 jobs to complete to start SR2 jobs. The SR jobs runs much faster than the LR jobs.

What I have done so far is ; Verify the LR jobs and write to 2 different files, completedLR.txt if it is completed and to runningLR.txt if it is still running. Simultaneously, I verify the SRjobs for completion. Its working for the first time. What Im having trouble with is to check the jobs after 3mins. Im having trouble in putting them into a loop where it will keep checking and also continue with starting the next set of jobs at the same time.

My main program calls a subprogram ;

main.sh
--- checkcomp.sh LR &
--- checkcomp.sh SR &
verify the completedLR.txt and go to the next set of jobs.

All the starting and verification of completion are against oracle tables. I have to just update the tables with timestamp for it to start the job and verify the stoptime for completion. Im very much confused to find a way to run one process which will keep checking the completion every 3mins and the other one to proceed further with the next and then the next set of jobs continuously.

Im not that wellversed in Unix. Any kind of help would be much appreciated. Im new to this forum as well. If I havent clarified anything clearly to help further, please let me know.

Thanks much in advance
Jay
# 2  
Old 07-10-2008
The company I work for is using UC4, a job management system. They have tons of different job plans and can manage such stuff easy with it.

Quote:
What Im having trouble with is to check the jobs after 3mins. Im having trouble in putting them into a loop where it will keep checking and also continue with starting the next set of jobs at the same time.
Else I suggest to write a simple shell script triggered every minute by cron to verify which job has run (ps -ef or as you do SELECT for some timestamps) and then run the next. Make that shell script reading a plain textfile, where you have your order of the scripts etc. in it and have the script processing it on the logic/order you want.
If you need to "remind" stati of different jobs beside the ps or SELECT on timestamps, you can easy use "lock" files by just touching them with the information you will need.
It will be a bunch of if/then/fi, while/do/done, case/esac and such to implement the logic you want.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Issue with search and replacing multiple items in multiple files

Im having an issue when trying to replace the first column with a new set of values in multiple files. The results from the following code only replaces the files with the last set of values in val.txt. I want to replace all the files with all the values. for date in {1..31} do for val in... (1 Reply)
Discussion started by: ncwxpanther
1 Replies

2. Shell Programming and Scripting

Issue Running UNIX process from CRON !!

Experts, Not sure whether the problem described here is related with Unix or is it with Oracle Installation. Here is the description of the issue: A new Unix server is setup as a part of Unix and Oracle upgradation activity for one of the Application, I work on. One strange thing is... (2 Replies)
Discussion started by: Oracle_User
2 Replies

3. Solaris

Process issue

They asked me to check is if process 'aanr' isn't working or hung!! $ ps -ef | grep aanr artsadm 11355 1 0 20:15:01 ? 0:00 /usr/local/bin/perl5 ./aanr artsadm 28203 1 0 Sep 06 ? 0:49 /usr/local/bin/perl5 ./aanr artsadm 24646 1 0 Sep 26 ? 0:00... (3 Replies)
Discussion started by: learner46
3 Replies

4. UNIX for Advanced & Expert Users

Issue while killing the process using autosys job

Hi, I have one autosys job that will retrieve the proccess id's and will kill those processess as follows, pid=`/usr/ucb/ps -auwwxx | grep MAIN |nawk '{print $2}'` kill -9 pid but after executing this particular job, its status is showing as TE(terminated) and the kill process is... (3 Replies)
Discussion started by: Kattoor
3 Replies

5. Shell Programming and Scripting

Snmp Process Monitoring Issue

Can someone please explain to me how come snmpwalk doesn't always find a running process that's on a remote server? I prefer to use snmp to monitor processes remotely because this doesn't require me to put a script on that remote box. but the problem is, there are times that my snmp command... (2 Replies)
Discussion started by: SkySmart
2 Replies

6. UNIX for Dummies Questions & Answers

Multiple instance of same process

;)Hi Everyone, I am using solaris 5.10. I have a java process running in server mode in unix. The problem is that it automatically forks i.e creates a child process. I mean suddenly two instances of that process start running , in which the process-id of first instance is the parent... (0 Replies)
Discussion started by: glamo_2312
0 Replies

7. Shell Programming and Scripting

Issue in mail sending process

Hi I created one CSV file and i need to append some message in the content of my mail. $sales=sales.dat $sales_csv=sales.csv $sales_report=sales.txt this is the command am using it. echo "sales for `date`"| read subject uuencode $sales $sales_csv | mailx -ms "${subject}."... (2 Replies)
Discussion started by: bobprabhu
2 Replies

8. UNIX for Advanced & Expert Users

Oracle library issue in child process

Hi, I am using a daemon from which I am forking 3 processes P1,P2,P3 out of which P3 is compiled with oracle lib32/libclntsh.so and P1,P2 are non database process. The Logic of daemon is that if any one goes down simply clean the other and refork all the 3 again. P3 is getting forked first time... (1 Reply)
Discussion started by: unisuraj
1 Replies

9. Shell Programming and Scripting

Help in co-process issue

Would you please tell me any link to learn about the concepts of coprocess from teh start and tell me briefly its applications, ie when, where, why to use co-process, and ive seen its applied to much in an ftp script. why its importnat in an ftp script ill appreciata hihly your help. Thanks (2 Replies)
Discussion started by: alexcol
2 Replies

10. IP Networking

How to choose Multiple process or Multiple threads?

Hi All, Please explain me when i have to use multiple process and when I have to use Multiple threads? Please give me an example.It will be very helpful for me. Thanks in advance. (0 Replies)
Discussion started by: ashleykumar
0 Replies
Login or Register to Ask a Question