0
votes
1answer
24 views

How to dynamically chose PBS queue during job submission

I run a lot of small computing jobs in remote cluster where job submission is managed by PBS. Normally in a PBS (bash) script I specify the queue that I would like to submit the job through the ...
6
votes
4answers
105 views

disabling job control in bash (CTRL-Z)

It happens to me sometimes, that I press CTRL+Z by accident and my application disappears into background. I know, I can bring it back with fg, so it's not such a big deal. But I am wondering about ...
2
votes
1answer
280 views

ctrl c vs. ctrl z with foreground job

Ctrl+Z stops the job whereas Ctrl+C kills the job. Why is that? Wouldn't the other way make more sense? z@z-lap:~$ sleep 100& [1] 4458 z@z-lap:~$ sleep 200& [2] 4459 z@z-lap:~$ jobs [1]- ...
2
votes
1answer
100 views

Queue a task in a running shell

I often start a long running command that is bound to either CPU, Disk, RAM or Internet connection. While that is running, I find that I want to run a similar command. Let's say downloading something ...
0
votes
1answer
60 views

When executing a command, it is automatically suspended

The problem happened on one of my local machines with CentOS 6. I ssh to it from my MacBook trying to test a script, which is in /usr/local/bin. However, whenever I tried to execute the command, it is ...
1
vote
1answer
137 views

fg a bg process because you forgot to redirect output to /dev/null

I did Ctrl+Z bg with the intention of disowning next, but I forgot to redirect, now I cant get to my terminal because the scrolling of the output (tarballed a huge directory with verbose set). How do ...
3
votes
2answers
280 views

What is “Exit 2” from finished background job status?

I have an exercise to put in a file some data (*conf from some directories) and need to do this in background. I did it and I am wondering what is the meaning of output messages: [A@localhost tests]$ ...
3
votes
3answers
369 views

Pipe command output to input of running/backgrounded command

In Bash 4.X It it possible to do something like: command that expects input & echo some output | %1 Where %1 represents the first backgrounded command?
3
votes
3answers
196 views

Quick access to work directory of background job

Minimal effort to reproduce what I am looking for, is as follows /$ sleep 1h & [1] 6564 /$ cd ~$ jobs [1]+ Running sleep 1h & (wd: /) When I use jobs to manage my ...
4
votes
1answer
291 views

why do background jobs hang depending on the size of the output?

I had some stress-testing scripts that were running in parallel and they would hang after finishing and would wait for a RETURN keystroke to exit. After investigating I discovered that it is not ...
2
votes
1answer
236 views

Can I transfer running process from dead ssh [duplicate]

Possible Duplicate: How can I disown a running process and associate it to a new screen shell? I have started (as expected) a long copy process from ssh shell (putty) which died due to ...
2
votes
2answers
87 views

How to supress the display of previous job details?

When I run a process in the background the process ID gets displayed in the command prompt. For example: $ gvim 1 & [3] 9584 Now when I run another process the state of the previous one also ...
8
votes
4answers
4k views

How can I kill and wait for background processes to finish in a shell script when I Ctrl+C it?

I'm trying to set up a shell script so that it runs background processes, and when I Ctrlc the shell script, it kills the children, then exits. The best that I've managed to come up with is this. It ...
3
votes
1answer
3k views

How to recover a backgrounded job from a previous shell? [duplicate]

Possible Duplicate: How can I disown a running process and associate it to a new screen shell? I launched a command that lasts a long time. I had to disconnect so I moved it in the ...
1
vote
3answers
1k views

Bash wait for jobs and limit job count [duplicate]

Possible Duplicate: Four tasks in parallel… how do I do that? Suppose a loop invoking a command grep -v '#' < files.m3u | sed 's/\\\\/\/\//g' | sed 's/\\/\//g' | while read line ...
1
vote
2answers
712 views

Basic job control: stop a job, add a job onto the stack, and `fg`

Job control is probably my favorite thing about Linux. I find myself, often, starting a computationally demanding process that basically renders a computer unusable for up to days at a time, and being ...
0
votes
1answer
527 views

safely killing a background process

I'm writing data to a pipe in a parent process. The parent process creates a background job that reads data from the pipe & write it to the screen & to a log file. How can I know when to kill ...
7
votes
1answer
2k views

Non-blocking bash command

Let's say I have a bash script with the following: #!/bin/sh gedit rm *.temp When I execute it using sh ./test.sh, gedit pops-up but the rm part does not run until after I close gedit. I want the ...
16
votes
5answers
7k views

How can I close a terminal without killing its children (without running `screen` first)?

sometimes I run an app in the gnome-terminal, but then I suddenly have to restart gnome or something. I guess the answer to the question is also useful then I want to disconnect from SSH where ...
3
votes
1answer
366 views

Background task finished notification syntax

Last night, before abandoning my computer for the evening, I started a bunch of compiler jobs so they'd be ready in the morning, using make -f alpha.mak &>alpha.out &. When I came back and ...
1
vote
1answer
853 views

ant script stops, waiting for input when run in background

I'm running an ant (Java build tool) script on CentOS 5.5 that execs another java process. When I run the ant script in the background: ant -f myfile.xml &> foo.out & The forked process' ...
5
votes
2answers
1k views

How to suspend and resume processes

In the bash terminal I can hit Control+Z to suspend any running process... then I can type fg to resume the process. Is it possible to suspend a process if I only have it's PID? And if so, what ...