Job control in a shell

learn more… | top users | synonyms

3
votes
0answers
26 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 ...
0
votes
1answer
41 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
16 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
1answer
35 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
66 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
33 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
16 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
70 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
498 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
36 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
78 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
31 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
35 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
90 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
101 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
171 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
440 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
71 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
223 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
36 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
96 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
134 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
44 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
224 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
41 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
52 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 ...
1
vote
0answers
185 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
79 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
2k 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
436 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
75 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
309 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
176 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 ...
1
vote
1answer
715 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 > ...
1
vote
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
128 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 ...
4
votes
3answers
208 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
83 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 ...
1
vote
2answers
139 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 ...
2
votes
2answers
2k views

Killing subprocesses after the script has finished or is killed

Say I have a script like the following #!/usr/bin/env zsh ./subscript.sh & # do stuff ... # do more stuff I would like the process running subscript.sh (and any processes initiated by it) to be ...
3
votes
3answers
367 views

Intelligently switch between multiple BASH processes

Say you're in a directory and you want to check something in another directory, so you type bash to spawn a new shell so you can cd and check that thing and then type exit to get out and go back to ...
2
votes
3answers
313 views

When does one get the error message “jobs : not found”?

When does the jobs command issue the message jobs : not found? Also, why does the command man jobs refuse to show any entry for the command jobs? P.S. : I am able to successfully execute the jobs ...
1
vote
3answers
24k views

How to get the Job ID? [duplicate]

As we know, the shell enables the user to run background processes using & at the command line's end. Each background process is identified by a job ID and, of course, by it's PID. When I'm ...
10
votes
3answers
5k views

If you ^Z from a process, it gets “stopped”. How do you switch back in?

I accidentally "stopped" my telnet process. Now I can neither "switch back" into it, nor can I kill it (it won't respond to kill 92929, where 92929 is the processid.) So, my question is, if you have ...
6
votes
4answers
10k views

Ctrl-C with two simultaneous commands in bash

I want to run two commands simultaneously in bash on a Linux machine. Therefore in my ./execute.sh bash script I put: command 1 & command 2 echo "done" However when I want to stop the bash ...
43
votes
5answers
144k views

How to stop a background process?

I have started a wget on remote machine in background using &. Suddenly it stops downloading. I want to stop its process, then start it again. How can I stop it? I haven't close its shell window. ...