Problem with Background Jobs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem with Background Jobs
# 1  
Old 05-04-2010
Problem with Background Jobs

We had a generic process where the jobs are scheduled to run sequentially and in background. We are noticing the problems with the background jobs.

Error Message:
Code:
/bin/ksh: /home/suren/bin/GenericReportScript.sh: cannot execute

The same script is existing in bin and it had enough privileges to execute and this script is being called by both background and sequential jobs.

Weekly once or twice we notice background jobs failing with the mentioned error message (Not the same job every time).

What could be the reason for this failures? What else need to be checked or taken care in scripting?

Thanks in advance.
Surendra

Last edited by vbe; 05-04-2010 at 10:04 AM..
# 2  
Old 05-04-2010
You have not provided any information regarding your environment, nor have you provided the code of the scripts involved, nor the code that launches the scripts (a crontab, I presume). Although, even if you had, intermittent failures can be difficult to debug without access to the machine(s) in question.

Generally, speaking:
1. You could grep the source to your shell for all instances of 'cannot execute' and see what can trigger that error message.
2. You can modify the way the scripts are launched to enable tracing, and log the trace to a file by redirecting standard error.
3. If the filesystem on which the scripts reside is remote, perhaps you are experiencing intermittent failures on the network/fileserver.

And that concludes my shots in the dark.

Good luck,
Alister
# 3  
Old 05-04-2010
I agree with Alister, this is pure guesswork.

Please post the actual permissions of the script.
Code:
ls -lad /home/suren/bin/GenericReportScript.sh

And state the unix usernames (with group names) of the users which will execute this script.

Is there any simple pattern for the failure?
Is cron involved or are the background tasks invoked by some other method?
If it is a cron, please post the name of the user owning the cron and the whole line from crontab.

Fundamentals:
What Operating System are you running?
Do you have any diagnostic tools such as "sar"?
I strongly suspect that you are blowing a kernel parameter such as the maximum number of processes for one user.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Use of screen in running background jobs and how to use this

Hello, Please advise use of screen in running jobs in nohup background and how to use this Best regards, Vishal (1 Reply)
Discussion started by: Vishal_dba
1 Replies

2. Red Hat

shc utility for background jobs

I have used shc utillity to convert a shell script to it's compiled version.Inside this script i have called another shell script which is also in compled version. Example:- Main script:- main.sh.x child script:- child.sh.x (this is called inside main.sh.x) This child script will run in... (2 Replies)
Discussion started by: millan
2 Replies

3. Shell Programming and Scripting

Nohup and background jobs

Hi All, Can someone help me in knowing the exact difference between nohup and &. The definition is quite clear but i only want to know if i run my job using & and in between i hung up my terminal. (10 Replies)
Discussion started by: Uinx_addic
10 Replies

4. UNIX for Dummies Questions & Answers

Background jobs

If I run a job in the background and logoff. Will the job continue to run or will my processes be killed ? (1 Reply)
Discussion started by: jxh461
1 Replies

5. UNIX for Advanced & Expert Users

Notification from Background jobs

Reposting, as it got lost during the database backup. :( Via a shell script a spawn 3 background jobs namely a, b & c. These will take different times to complete. I want to print a different message on completion of each. How can i find out when each one has completed independently. ... (19 Replies)
Discussion started by: vibhor_agarwali
19 Replies

6. Shell Programming and Scripting

background jobs exit status and limit the number of jobs to run

i need to execute 5 jobs at a time in background and need to get the exit status of all the jobs i wrote small script below , i'm not sure this is right way to do it.any ideas please help. $cat run_job.ksh #!/usr/bin/ksh #################################### typeset -u SCHEMA_NAME=$1 ... (1 Reply)
Discussion started by: GrepMe
1 Replies

7. Shell Programming and Scripting

Issues with exit after running jobs in background

I have the following sample script to run a script the jobs with the same priority(in this case field3) in parallel; wait for the jobs to finish and run the next set of jobs in parallel.When all the lines are read exit the script. I have the following script which is doing evrything I want... (1 Reply)
Discussion started by: hyennah
1 Replies

8. Programming

Background jobs

Hi there, I'm quite new to UNIX for programming. I have a script that does this: Shows on screen real-time results taken from phone calls and logs them in a file. However, when I start my script, I want my script to start logging in the file in the background, so I can continue working on... (1 Reply)
Discussion started by: Jeremiorama
1 Replies

9. UNIX for Dummies Questions & Answers

Checking background jobs from another session

Ok, so I'm comfortable backgrounding jobs in the shell, starting and stopping them, and bringing them to the fg and bg. What I can't figure out is how to monitor those background jobs from another shell (remote, or local). Example: - On a local console for MYHOST, I su to root - I then update... (3 Replies)
Discussion started by: vikingshelmut
3 Replies

10. Shell Programming and Scripting

background jobs

Hi, i have a problem with turning a job into backgrund. When i enter this at the shell: spice -b darlington.cir -r output.raw > screenout.tmp & and then let me show the currently running jobs, i get the following output: + Suspended (tty output) spice -b darlington.cir -r output.raw >... (4 Replies)
Discussion started by: qsi
4 Replies
Login or Register to Ask a Question