Job control


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Job control
# 1  
Old 04-04-2007
Job control

Hello,

What is the best way to control the running of scripts?

For example, i have a k1.ksh script java pgm that checks to make sure that the file counts in a particular directory are equal to a total file count value in a control file updated from my PC.

If i run this k1.ksh script and the total counts are equal, what would be the best way to kick off the k2.ksh script to execute a database update?

Should i use a kshell language and say put is something like "if [.......] then...." in the script or is there a better way to determine when to kick off k2.ksh?

Thanks very much for any insights on this!
BobK
# 2  
Old 04-05-2007
Quote:
Originally Posted by bobk544
Hello,

What is the best way to control the running of scripts?

For example, i have a k1.ksh script java pgm that checks to make sure that the file counts in a particular directory are equal to a total file count value in a control file updated from my PC.

If i run this k1.ksh script and the total counts are equal, what would be the best way to kick off the k2.ksh script to execute a database update?

Should i use a kshell language and say put is something like "if [.......] then...." in the script or is there a better way to determine when to kick off k2.ksh?

Thanks very much for any insights on this!
BobK
I'd do it your way and test the return code from the previous script eg
Code:
                       ksh ./k1.sh  
                         
 			if [ $? -ne 0 ] ; then
				TestRunResult=fail
                                return 1
 	      		else
	 			TestRunResult=pass
                                ksh ./k2.sh
 			fi

# 3  
Old 04-05-2007
Thank you for your help on this, have a great week!

BobK
# 4  
Old 04-05-2007
Thanks again OFFSIHR for including that "return 1" in the example, now i see how i can call another .ksh and get back a result value, always wondered abou that!!!

good one! Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Job Control

Using a named pipe. Run a find in the background starting in the working directory While this is happening wait for input from the user to ask him which file to find. If the user does not enter any data in 10 seconds ask the user again. Then see if the requested file name is found from the output... (0 Replies)
Discussion started by: kattak1511
0 Replies

2. HP-UX

Control-M Job trigger

Hi, I'm totally new in Control-M and I really need some help. Here's my problem. I need to make job X from a server trigger job Y from a different server where job X must receive a confirmation first before execution. :confused: I really have no idea on how to do that so can you please give... (1 Reply)
Discussion started by: criphaze22
1 Replies

3. Shell Programming and Scripting

Script to Start a Job after finding the Old job completed

Hi Experts, I need a script advice to schedule 12 jobs ( SAS Codes execute back ground ). Algorithem: 1. Script checks first job. 2. Finds first job is done; invoke second job. 3. finds second job is done; invoke third job. .. Request you to please assist. (3 Replies)
Discussion started by: Jerald Nathan
3 Replies

4. UNIX for Advanced & Expert Users

Unix Control M - Job selection critiria

Hello all, Being new to UNIX and Control-M I've runned in some kind of trouble. If I'm not mistaking Control M performs job selection upon 3 main criteria: 1- If a Job is or is not critical 2- The job's priority 3- Job's "Time From, time until" parameter Mi question concerns the... (1 Reply)
Discussion started by: gforbice
1 Replies

5. UNIX for Advanced & Expert Users

can some one give me some link about process and job control commands

can some one give me some link about process and job control commands (2 Replies)
Discussion started by: alokjyotibal
2 Replies

6. Shell Programming and Scripting

job/process scheduling or control

Hi forum, I have a problem concerning job or process scheduling and control. I have to run 24 jobs (could be more sometimes less) of the same programme with different parameters. The machine this code is running on is an 8-core machine, so I was thinking that running all the processes at once... (0 Replies)
Discussion started by: deiphon
0 Replies

7. UNIX for Advanced & Expert Users

Documentation and books on Autosys Job Control Tool from Autosys

My project uses Autosys. I am new to this product and I don't know where to start from. Q1. Please provide me the link where I can get Autosys documentation Q2. Please refer a good book on Autosys. (Beginner/Intermediate Level) (0 Replies)
Discussion started by: gram77
0 Replies

8. Solaris

killing a unix job after the job process gets completed

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. Thanks... (7 Replies)
Discussion started by: dtazv
7 Replies

9. Shell Programming and Scripting

killing unix job after the job process completes

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. ... (1 Reply)
Discussion started by: dtazv
1 Replies

10. UNIX for Dummies Questions & Answers

Sending control sequence to printer before job

I am having difficulty sending a control sequence ESC&l5H (print to middle tray) to a HP printer (lp4).It is ignoring the command. I am using the following syntax in an executable file : echo "'/033'&l5H" > /dev/lp4 lp -dlp4 filename a) Is /033 'escape' ? b) What is the correct syntax ? (5 Replies)
Discussion started by: ianc
5 Replies
Login or Register to Ask a Question