The nohup tag has no wiki summary.
64
votes
1answer
10k views
Difference between nohup, disown and &
What is the difference between
$ nohup foo
and
$ foo &
and
$ foo &
$ disown
9
votes
2answers
377 views
How can I tell a running process to disregard SIGHUP? [duplicate]
Possible Duplicate:
How can I close a terminal without killing the command running in it?
I have a very low-end "server" running Debian Squeeze that I occasionally ssh to. The system tends ...
7
votes
2answers
1k views
When do you need 'nohup' if you're already forking using '&'?
First this question is related but definitely not the same as this very nice question:
Difference between nohup, disown and &
I want to understand something: when I do '&', I'm forking ...
7
votes
6answers
10k views
Execute remote commands, completely detaching from the ssh connection
I have 2 computers, localpc and remoteserver.
I need localpc to execute some commands on remoteserver. One of the things it needs to do is start a backup script that runs for a number of hours. I ...
5
votes
3answers
736 views
Why are background jobs started by my shell living longer than the parent shell and controlling terminals?
It is commonly said that "&" puts the process into background execution, but that process would be killed when terminal is closed. But from what I see, everything I sent into background was ...
5
votes
3answers
1k views
nohup vs. Screen
In the past, I've used nohup to run big background jobs, but I've noticed that a lot of people use Screen in this context. Does Screen provide some kind of functional advantage that I am unaware of, ...
5
votes
3answers
661 views
Why `> my.log 2>&1 &` causes the job to sustain log out?
I use
myscript > my.log 2>&1 &
to run a script and collect it's output - so that when I logout - the script will still be running. It I were to start it with myscript & - it will ...
4
votes
3answers
1k views
How to totally fork a shell command that is using redirection
I've written quite a few shell scripts over the years (but I'm certainly not a sysadmin) and there's something that always caused me troubles: how can I fork a shell command immune to hangups in the ...
4
votes
1answer
2k views
Execute Nohup command with input
In UNIX, I have a process that I want to run using nohup. However this process will at some point wait at a prompt where I have to enter yes or no for it to continue. So far, in UNIX I have been doing ...
3
votes
2answers
495 views
Is it possible for nohup to write the output both to the file nohup.out AND to the screen/terminal?
I am using the bash shell. I frequently use nohup to ensure that my processes are not stopped when I close the shell/terminal that started them. I use a syntax like:
nohup myprocess
When ...
3
votes
1answer
3k views
Is there a way to redirect nohup output to a log file other than nohup.out?
I frequently use the program nohup so that my processes are immune to hangups. So if I want to make the program program immune to hangups, I use the command
nohup program &
where & puts ...
3
votes
2answers
99 views
Simulate empty STDIN to detached command
i want to detach command either with 'command &' in the end, or with 'nohup command &', but it stops right after detaching it.
command is little specific, if it receives eof on input, it ...
3
votes
2answers
124 views
Disown won't take -h option
I'm running a command that I now realize I'd like to leave running after I close my SSH session. I didn't start it with a & argument, but I have put it in the background (CTRL-z, bg). Now I'm ...
3
votes
3answers
2k views
Using nohup on Solaris 10
I need to transfer a large number of files over SFTP (only between Solaris servers) which takes a very long time. I cannot keep my PC on for this duration. I tried:
nohup sftp server1
While the ...
3
votes
1answer
148 views
Having an rsync job complete after closing SSH connection
I am transferring a large amount of files from one computer to another using rsync. I am doing this by SSHing into the source computer and executing a command like this:
sudo rsync ssh ...
3
votes
3answers
145 views
Running multiple nohup commands in background
Got two commands cmd1 and cmd2. Of the two, cmd2 takes longer to finish. Need to run cmd2 and then cmd1.
Tried to run them in following way:
bash$ (nohup ./cmd2>result2 &) && nohup ...
2
votes
1answer
90 views
What does a “[1]+ Exit 1” response mean?
I ran this command to try and get my python program to run in the background and let me exit the SSH connection I am using:
nohup python files.py >> files.log &
I then check ps to check ...
2
votes
2answers
209 views
Why do 'nohup' and 'disown' not work on SoX (invoked as 'play')
I can run this command:
$ play mylist.m3u
And music plays.
I can then press Ctrl-Z to suspend the job, and issue bg to have it run in the background.
However, if I then run disown and exit, the ...
2
votes
1answer
28 views
redirection to file issues with nohup and pipe
for the following script
ssh -t esolve@hostname 'sudo nohup bash -c "ls > log 2>&1 &"'
I always got error information:
nohup: ignoring input and appending output to ...
2
votes
3answers
939 views
Dtach and Vim over Ssh: Reattach Session
I connected to my server:
$ ssh me@example.com
While in the server, I open a dtach session with vim:
$ dtach -c \tmp\my-dtach-session-pipe vim
Then my ssh session dies. I attempt to go back to ...
2
votes
1answer
128 views
starting server with nohup and redirecting input, output
I have a init.d script that starts a python socket server. Because I want this to run as a daemon, I use nohup to start it. I also want to redirect stdout and stderr to a log file. My problem is ...
1
vote
4answers
764 views
How to limit the number of lines a command's output has available in bash?
I started downloading a big file in the background using
$ nohup wget http://example.tld/big.iso &
which also gives me a nohup.out file that includes the output of wget.
Now, if I later want ...
1
vote
1answer
1k views
How to make nohup not create any output files and so not eat all space?
So I start some server with nohup ./myServer &, I actually have loging mon my server so I do not need any help from nohup with it, but any way I get 66GB nohup.out file in fiew days and that is a ...
1
vote
4answers
734 views
How to prevent a program from dying when its ssh session dies?
I have a really old console application that I want to make a bit more resilient. The program is used this way:
the user uses a custom terminal emulator to connect to a remote machine through ssh
...
1
vote
2answers
667 views
How can I keep processes running on a remote server even after turning off the terminal machine?
..and then still be able to return to the same session/screen after restarting the terminal machine.
I've tried screen but once I restarted my computer screen -d showed no sessions. Nohup seems to be ...
1
vote
2answers
899 views
How to make a program which run from shell still live after close terminal? [duplicate]
Possible Duplicate:
How do I prevent a script from terminating when the shell exits?
I use gnome-terminal, and I run emacs under the terminal in the background by executing emacs &, but ...
1
vote
1answer
106 views
nohup sends eof (or some other data) info my app when running recursively. How to make it stop or not send at all?
I have a simple small app that suports cin/cout interaction. But there are times (lots of them) when I do not care about that interaction and just want to run my app in background. So I start it with ...
1
vote
2answers
81 views
How to know if a background job is finished?
I invoke a script (do_something) in background via another script (do_manythings) as below.
nohup do_something &
How would I know in the parent script (do_manythings) that the job invoked ...
1
vote
1answer
49 views
How get program name that produced an IO error redirected to a LOG in a nohup command?
I have a program that executes other programs in the background. The main program would be programA, and the programs executed by the main one, would be program1a, program1b and program1c.
I need the ...
1
vote
0answers
53 views
how to run ssh -t user@remote 'sudo nohup bash -c “comand”' in background
I want to run a script on a remote host with sudo priviledge,
someone suggests that I should use nohup and ssh -t, like the following command
the script ls;sleep 10;echo finish is crafted here to ...
0
votes
2answers
746 views
ssh + nohup does not work
I'm trying to run a program over SSH that keeps running when I disconnect. This Stack Overflow answer gave me the following command:
nohup sleep 30 > foo.out 2> foo.err < /dev/null &
...
0
votes
1answer
52 views
Starting Resque worker with script doesnt work, starting by hand does
I am trying to figure out why my process doesn't work if started via a script, but works fine if started by hand.
Here's the details:
script is a resque worker start script. The script location is ...
0
votes
1answer
90 views
Kill nohup command on cluster
Last night I launched a command via nohup on a cluster and then closed the connection. Today I would like to kill this job (I know it's still running because output is being generated in an output ...
