Job control in a shell

learn more… | top users | synonyms

0
votes
1answer
19 views

Why does the jobs command not work in shell script?

If I run jobs -l on command prompt it shows me the status of running jobs but if I run below file ./tmp.sh #! /bin/bash jobs -l It shows empty output. Why is that and how can I obtain information ...
5
votes
1answer
52 views

Cannot grep jobs list when jobs called in a function

I can grep the output of jobs, and I can grep the output of a function. But why can't I grep the output of jobs when it's in a function? $ # yes, i can grep jobs $ jobs [1]+ Running vim ...
1
vote
2answers
51 views

how to kill job in background?

I know how to kill a job with kill %(number) but is it possible to kill a job as background job, the question is "kill tail as a background job?"
3
votes
2answers
31 views

Is there a limit to processes I can run in the background?

Is there a limit to how many jobs you can have running in the background when using command prompt? I've heard varying answers to this question, but is there a concrete number that is set as the ...
-2
votes
5answers
60 views

How to find PID of an ongoing job in UNIX?

I executed a shell script which will call some internal applications and will take few hours. Due to some problems, I have to stop or kill that job. For this, first of all, I ran ps -u $uname to list ...
0
votes
3answers
70 views

process command and the percent sign usage

I am confused about stopping a job by using the percent sign with the kill command. I cannot find any documentation in the man pages for kill that indicate the percent sign can be used. Can someone ...
-1
votes
1answer
63 views

Is there a way of getting full name of background jobs/ processes?

jobs -l This lists the jobs, but my job names are long and identical and this leads to a confusion as to which one them completed. Eg: if my jobs are: aaaaaabbbbbbccccc...............123 ...
3
votes
0answers
45 views

Job queueing on a single machine

I have a shiny new server for running simulations on, with a pair of Tesla GPUs and 32 cores, running CentOS 7.2. I'd like for multiple users to be able to submit jobs to the server that get queued up ...
1
vote
1answer
107 views

Kill a running shell script, and kill all process running within it

I have a shell script running in the background, which runs 5 different jobs. When I run the shell script all 5 jobs start running in order. When I kill this shell, whichever process is running, will ...
0
votes
1answer
27 views

Get PID of scheduled job (using at)?

Say I want to schdule this job to be run at later time MYPROGRAM > output.out 2> error.err | at 02:00 PM Mon How can I attain its PID? surly using: echo $! will not work?
0
votes
0answers
63 views

How to check if process completed successfully or if there are any errors?

MYPROGRAM > output.out 2> output.err The two files will be generated: output.err and output.out. Surely after a job is completed its process ID no longer exists, but how can I check if it ...
4
votes
1answer
82 views

Why is subshell created by background control operator (&) not displayed under pstree

I understand that when I run exit it terminates my current shell because exit command run in the same shell. I also understand that when I run exit & then original shell will not terminate because ...
0
votes
1answer
61 views

Schedule a job to run in the background ( one time task scheduling using at )

Is it possible to request for a job to be run at a later specifed time in the background? This is what I have so far, nohup nice MY_PROGRAM > foo.out 2> foo.err < /dev/null | at 05:23 PM ...
1
vote
1answer
21 views

jobs / wc: getting wierd return values

I can't make sense of these return values. When I run jobs -s | wc -l, I get different results depending on what directory I'm in. If I'm in the directory that I returned to after suspending the ...
3
votes
1answer
106 views

Shell function to check if there is a suspended process that's a child of this shell?

I'd like to add an indicator to my PS1, showing whether there is a process suspended with ctrl+z. In order to do so, I'll need a function that is able to check for this situation. I'm not even sure ...
7
votes
2answers
545 views

Ctrl-C kills whole line while Ctrl-Z doesn't

I am running multiple commands on the command line separated using semi-colons: cmd1; cmd2; cmd3 If I press Ctrl+C on the above, it would kill all commands instead of just the one which is executing ...
0
votes
0answers
33 views

Will reinstalling cluster OS help running the jobs from being in queue?

I have a problem submitting my jobs to a cluster. I can upload and download files to and from cluster that I am working with but the cluster is unable to run the jobs submitted to them. As I check the ...
0
votes
2answers
46 views

How to resume a program when logged in with different session

Here is the scenario: Let's say that I log into my server via ssh and start an emacs or vi (or whatever other program) session. Then my ssh connection disconnects. Is there a way for me to reconnect ...
2
votes
1answer
132 views

zsh wait for jobs to complete

When I type the following in my terminal running zsh (each line is a command) babel www/scripts6/lib/data.js > www/scripts/lib/data.js & babel www/scripts6/lib/user.js > ...
0
votes
1answer
35 views

Cannot disown mplayer?

mplayer -vo null -ao alsa test.mp3 & disown It returns sh: 1 : disown: not find Why it doesn't work?
0
votes
0answers
37 views

submitting a job array script on SGE

I am trying to make a job array script to do a particular task for several files. Let's assume as a start for only 2 fastq files. Name : abc.fastq , def.fastq #!/bin/bash file=$(ls -1 *.fastq | ...
0
votes
2answers
136 views

Live monitoring of background jobs

I executed a command like this: nohup some_command &. Now this command is in the background. I can see it with the command jobs. Example output: [1]+ Running nohup some_command ...
6
votes
1answer
125 views

Is it possible to add a process to the job list in bash (e.g. to reverse “disown”)?

If I disown a job in bash and change my mind, can I undo it somehow ? If so, taking it further, is it possible to bring an arbitrary process under job control (an acceptable restriction would be that ...
5
votes
2answers
243 views

How to launch gedit from terminal and detach it (just like “subl” command works)?

To open a file to edit in gedit I run gedit sample.py &. But with Sublime Text it is simply subl sample.py. This opens the file to edit and it doesn't run in the background (in my shell). How ...
2
votes
3answers
523 views

Do I need a computer science degree to have a successful career in Linux? [closed]

I recently got a bachelor's in hospitality management, for 4 years I basically lied to myself thinking thats what I want to study while neglecting my interest in computer science. I've been getting to ...
0
votes
1answer
86 views

How to use jobs command and view results

I am using Ubuntu 14.04 and I am trying to view the list of running jobs using the jobs command yet there is no results shown and when I enter "man jobs" the shell responds that there is no such ...
1
vote
1answer
412 views

Disowned “Stopped” job process still appears in process table

I want to know why after disowning the stopped process, it is still appearing the process table PING www.google.com (74.125.130.106) 56(84) bytes of data. 64 bytes from 74.125.130.106: icmp_seq=1 ...
1
vote
0answers
42 views

How to view document name of a print job

How do I view the document name of a print job? The closest I've come to the answer is with this command... lpstat -W completed ...which displays several results with a timestamp, but no ...
1
vote
0answers
23 views

How do processes, jobs and session relate to each other ? [duplicate]

Could you deliver an answer in a way that does not require too much special knowledge in advance, yet also deliver some deeper insight to a lesser advanced Linux User ?
0
votes
1answer
182 views

How to tell the memory usage of each background job

I am working on SGE, and I am logged on to it. I use qlogin -l mf=30G so as to get onto one compute node. I am running 2 jobs on this compute node in the background. [1] 4408 Running ...
4
votes
1answer
167 views

Why does 'jobs' always return a line for finished processes when run in a subshell within a script?

Normally, when a job is launched in the background, jobs will report that it is finished the first time it is run after the job's completion, and nothing for subsequent executions: $ ping -c 4 ...
2
votes
1answer
46 views

Is there a way to suspend an process belongs to shell A and foreground it in shell B?

I knew how to suspend one process and bring it into foreground in current shell, but I have no idea about that If I have run a process in shell A and now I want to bring it into foreground in current ...
0
votes
2answers
298 views

How to execute unix “jobs” command in python environment

I want to know currently running background process by using unix "jobs" command in python environment. I tried using import os os.system('jobs') but it not works for me
0
votes
1answer
45 views

unable to remove stopped job with ctrl+c

When I tried to change from super user to common user and therefore typed "exit", I got an error message, that a job was stopped and I could not log out as root. So I listed the jobs: #jobs [1]+ yes ...
2
votes
2answers
63 views

Modify background jobs and/or notify on job completion post-launch [duplicate]

I would like to be able to somehow modify a running command and/or get notified when a running command completes after it has been started. Normally, when I know a command is going to take a long ...
2
votes
0answers
246 views

Supervisord scheduling

Is it possible to set jobs to run every n days in supervisord, like what cron is doing? I'm asking because I have different kinds of jobs, continuous / real-time and daily ones. All my jobs are ...
1
vote
1answer
96 views

why jobs doesn't list commands from script

I have a script that runs some programs in the background, but after running it, they are not listed by the command 'jobs'. Why is this? (./m_prog -t m_prog1 m_config) & (./m_prog -t m_prog2 ...
0
votes
3answers
3k views

What is background and Foreground processes in Jobs

I'm studying Redhat Linux 7, topic Monitoring and managing Linux processes in it I understand Processess and its command. But I do not understand "Controlling Jobs" and Running jobs in the background ...
2
votes
1answer
578 views

Bash update list of running jobs with ps

I need to run in parallel a set of computationally intensive tasks. What I was trying to do is to maintain a list of pids corresponding to the running jobs and update the list of running jobs with ps ...
-4
votes
1answer
79 views

What is “jobs” commmand in Redhat Linux [closed]

What is jobs command in Linux and how to use it? Please give some example.
1
vote
1answer
352 views

What is JID (job ID) and is it always smaller than PID? [closed]

I don't know what exactly is JID (job ID) and how it is assigned. What is it's relation to PID and how does one number affect the size of the other in any way?
0
votes
1answer
254 views

command “jobs” cannot see the stopped jobs

I have wrote a very simple shell script to practice command "bg" , "fg" and "jobs": #!/bin/bash myvar=1 while [ $myvar -le 100000000 ] do echo $myvar myvar=$(( $myvar + 1 )) done I use ...
2
votes
1answer
1k views

redirecting output of running background job in bash

in bash I have some jobs running, in background. They are always producing random irrelevant error messages that pollute the terminal. I am not always so prompt to start them with the 2>&1 > ...
2
votes
2answers
1k views

Why double ampersand chained conditions runs in background together the last one?

I have some conditions for some background job to run: condition-command && condition-command && background-job & The problem is: I want the conditions to block until the job ...
2
votes
0answers
158 views

Configure job to expire

I'm learning Linux at the moment and were doing some exercises scheduling jobs with cron and crontab, but I'm wondering if it's possible to limit the amount of times that the scheduled job is ran. ...
3
votes
4answers
2k views

How to return a background task to be in the foreground?

Well, the title does not say much, but I would like to know how to stop a running process after appending it with &. For example, I would like to install software foo. Now, assume, foo has many ...
5
votes
3answers
223 views

How do I gracefully suspend and resume `cmd1 && cmd2 && cmd3` chain?

From the previous question it seems I failed to understand how && and ^Z interact properly: $ command1 && command2 && command3 Running command1 ... Running command2 ...^Z [1]+ ...
4
votes
2answers
85 views

How do I cancel/replace one element of running `cmd1 && cmd2 && cmd3 && …` chain?

$ command1 && command2 && command3 Running command1 ... Running command2 ...^Z [1]+ Stopped $ fg && command4 && wrong_command5 && command6 Running command3 ...
4
votes
0answers
37 views

Show error messages and information that a program was killed on another terminal [duplicate]

If I open a program, say evince, from the GNOME GUI, it is not attached to a terminal. If I send it a signal, it acts accordingly but nothing shows up in my terminal. If I were to open it in a ...
2
votes
2answers
158 views

Is it necessary to disown a process for it to continue running after disconnecting?

Would someone be kind enough to explain if & why disown is necessary if you wish to keep a job running even after you disconnect. I ask because every site I have visited says to use disown and bg ...