Sponsored Content
Top Forums Shell Programming and Scripting How to get the status code after using lsfsubmit? Post 302886178 by arghadeep adity on Thursday 30th of January 2014 02:35:28 AM
Old 01-30-2014
How to get the status code after using lsfsubmit?

Hi,

I am a tester and i am trying to create a batch job.

My dev has created few scripts which performs specific task. Manually we need to run these script one by one. We can only run scriptname2 if script name1 completes.

Code:
lsfsubmit <scriptname1> <param1> <param2> 
lsfsubmit <scriptname2> <param1> <param2>

When this script is run, I immediately get status as DONE on my console.
If i execute command bjobs on the prompt, i can see <scriptname1> still running at the background.
This is not the problem.....

Now, the batch job that i created will take these script one by one and execute them. The condition is same. Unless one script completes, we cannot run the other script. My code is doing the same thing

BUT

My ACTUAL PROBLEM is when my script runs this <scriptname1>, it will capture the status code even before the job is complete at the background, hence it returns the status code as 0 ALWAYS. I beleive this is because lsfsubmit returns DONE at the console but runs the job @ the background.


I want to wait for the job @ the background to complete and the capture the status code as 0 or non 0.
How to do that?

thanks
arghadeep

---------- Post updated at 02:35 AM ---------- Previous update was at 02:26 AM ----------

Code:
lsfsubmit Commission.sh ${PARAMARGS}   
temp=$?
 
if [ ${temp} != 0 ]
then
else
fi


Last edited by Don Cragun; 01-30-2014 at 03:51 AM.. Reason: Add CODE and ICODE tags.
 

9 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

Receiving status code 39 when accessing files through program.

I'm working on a project to extract some information from archive file. I ran my program through MFCobol animator and I'm receiving a status code of 39(file not compatible) when opening the file for input. I have tried just about everything, rebuild, convert, etc. but I receive the same message.... (6 Replies)
Discussion started by: bigdawg
6 Replies

2. Shell Programming and Scripting

Status code of last command execution

Hello people, I am using KSH and inside my script I do a cksum and check the status code to see whether the command sucessfully. Here even though the cksum fails due to file not existing the status returned is still 0 because the awk command worked fine. How do I capture just the status of the... (1 Reply)
Discussion started by: tipsy
1 Replies

3. Shell Programming and Scripting

How to capture status code and echo a message

Im trying to execute application and its return code is below IF Status code=o echo "........" else Staus Code =-2 DJRE then echo "......" Can any one help me how to handle the status code and echo some message. (12 Replies)
Discussion started by: laknar
12 Replies

4. Shell Programming and Scripting

Terminal And Cron Job Return Different Status Code

Dear All, I want to write a shell script to test the server is running or not. The method is pinging the server and examine the status code. the script: #/bin/tcsh ping -c 3 host if ($? != 0) then actionA endif This script work fine in terminal. The status code is 0 when the... (1 Reply)
Discussion started by: isaac_ho
1 Replies

5. Solaris

Tomcat Error-HTTP Status code 500

when I typed path http://localhost:8080/MyFirst/HelloWorld in web-browser ,it came up with error HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception ... (0 Replies)
Discussion started by: srinivas2828
0 Replies

6. UNIX for Dummies Questions & Answers

302 server status code to 301/404 server status code

Hello, Sorry for my english. I have an arcade site. mydomain.com/game.html If database has the game name is good. mydomain.com/fd43f54.html if database has not the game name redirect to mydomain.com by 302 error code. if database has not the game name i want a 301/404 error code and no... (0 Replies)
Discussion started by: hoo
0 Replies

7. Shell Programming and Scripting

Status code checker for 1300 URLs is running 15 mins

hi All, I wrote a shell script for checking the status code of the pages. for 1300 URLs, it is taking 15 mins to run. Can anyone pls provide a solution to make the script to run faster. about 5 mins.. In my script i used "while loop" and "wget --server-response". Thank You! (16 Replies)
Discussion started by: vidhyaS
16 Replies

8. Shell Programming and Scripting

Checking LB status.. stuck in script syntax of code

#!/bin/ksh #This script will check status of load balancer in AIX servers from hopbox #Steps to do as folows : #Login to server #netstat -ani | grep <IP> #check if the output contains either lo0 OR en0 #if the above condition matches, validation looks good #else, send an email with impacted... (7 Replies)
Discussion started by: vinil
7 Replies

9. Shell Programming and Scripting

Understanding exit code status

I have a file with size as 120,371 bytes in local machine and trying to FTP it to a remote server using put command. say that it transferred exactly the same size of 120,371 bytes and hence it returns a 226 code. I have a doubt on how the rule is made for 226 - if both size on local and remote... (7 Replies)
Discussion started by: penqueen
7 Replies
GEARMANCLIENT.DOBACKGROUND(3)						 1					     GEARMANCLIENT.DOBACKGROUND(3)

GearmanClient::doBackground - Run a task in the background

SYNOPSIS
public string GearmanClient::doBackground (string $function_name, string $workload, [string $unique]) DESCRIPTION
Runs a task in the background, returning a job handle which can be used to get the status of the running task. PARAMETERS
o $function_name - A registered function the worker is to execute o $workload - Serialized data to be processed o $unique - A unique ID used to identify a particular task RETURN VALUES
The job handle for the submitted task. EXAMPLES
Example #1 Submit and monitor a background job The worker in this example has an artificial delay introduced to mimic a long running job. The client script periodically checks the status of the running job. <?php /* create our object */ $gmclient= new GearmanClient(); /* add the default server */ $gmclient->addServer(); /* run reverse client */ $job_handle = $gmclient->doBackground("reverse", "this is a test"); if ($gmclient->returnCode() != GEARMAN_SUCCESS) { echo "bad return code "; exit; } $done = false; do { sleep(3); $stat = $gmclient->jobStatus($job_handle); if (!$stat[0]) // the job is known so it is not done $done = true; echo "Running: " . ($stat[1] ? "true" : "false") . ", numerator: " . $stat[2] . ", denomintor: " . $stat[3] . " "; } while(!$done); echo "done! "; ?> The above example will output something similar to: Running: true, numerator: 3, denomintor: 14 Running: true, numerator: 6, denomintor: 14 Running: true, numerator: 9, denomintor: 14 Running: true, numerator: 12, denomintor: 14 Running: false, numerator: 0, denomintor: 0 done! SEE ALSO
GearmanClient::doNormal, GearmanClient::doHigh, GearmanClient::doLow, GearmanClient::doHighBackground, GearmanClient::doLowBackground. PHP Documentation Group GEARMANCLIENT.DOBACKGROUND(3)
All times are GMT -4. The time now is 05:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy