Questions tagged [nohup]

nohup is a POSIX command to ignore the HUP (hangup) signal, enabling the command to keep running after the user who issues the command has logged out.

nohup is a POSIX command to ignore the HUP (hangup) signal, enabling the command to keep running after the user who issues the command has logged out. The HUP (hangup) signal is by convention the way a terminal warns depending processes of logout.

717 questions
1077
votes
10 answers

How do I put an already-running process under nohup?

I have a process that is already running for a long time and don't want to end it. How do I put it under nohup (that is, how do I cause it to continue running even if I close the terminal?)
flybywire
  • 261,858
  • 191
  • 397
  • 503
313
votes
7 answers

What's the difference between nohup and ampersand

Both nohup myprocess.out & or myprocess.out & set myprocess.out to run in the background. After I shutdown the terminal, the process is still running. What's the difference between them?
Yarkee
  • 9,086
  • 5
  • 28
  • 29
303
votes
5 answers

Can I change the name of `nohup.out`?

When I run nohup some_command &, the output goes to nohup.out; man nohup says to look at info nohup which in turn says: If standard output is a terminal, the command's standard output is appended to the file 'nohup.out'; if that cannot be…
David LeBauer
  • 31,011
  • 31
  • 115
  • 189
301
votes
17 answers

How to get the process ID to kill a nohup process?

I'm running a nohup process on the server. When I try to kill it my putty console closes instead. this is how I try to find the process ID: ps -ef |grep nohup this is the command to kill kill -9 1787 787
user2535056
  • 4,003
  • 5
  • 17
  • 13
182
votes
7 answers

Nohup is not writing log to output file

I am using the following command to run a python script in the background: nohup ./cmd.py > cmd.log & But it appears that nohup is not writing anything to the log file. cmd.log is created but is always empty. In the python script, I am using…
user1642513
105
votes
7 answers

How to get a list of programs running with nohup

I am accessing a server running CentOS (linux distribution) with an SSH connection. Since I can't always stay logged in, I use "nohup [command] &" to run my programs. I couldn't find how to get a list of all the programs I started using…
Nils De Winter
  • 1,370
  • 3
  • 11
  • 20
48
votes
5 answers

Run a program from python, and have it continue to run after the script is killed

I've tried running things like this: subprocess.Popen(['nohup', 'my_command'], stdout=open('/dev/null', 'w'), stderr=open('logfile.log', 'a')) This works if the parent script exits gracefully, but if I kill the…
James
  • 24,676
  • 13
  • 84
  • 130
46
votes
10 answers

Getting sudo and nohup to work together

Linux newbie here. I have a perl script which takes two command line inputs. I tried to run it in the background but this is what I got: [~user]$ nohup sudo ./ascii_loader_script.pl 20070502 ctm_20070502.csv & [2] 19603 [~user]$ nohup: appending…
Alex Chen
  • 535
  • 1
  • 5
  • 7
45
votes
4 answers

Use SSH to start a background process on a remote server, and exit session

I am using SSH to start a background process on a remote server. This is what I have at the moment: ssh remote_user@server.com "nohup process &" This works, in that the process does start. But the SSH session itself does not end until I hit…
futureshocked
  • 2,105
  • 4
  • 23
  • 32
42
votes
5 answers

What's the nohup on Windows?

I want to run a Java jar file like this: java -jar spider.jar How to run it on the background on Windows? Like this on Linux: nohup java -jar spider.jar > /var/tmp/spider.log 2>&1 &
www
  • 4,065
  • 7
  • 30
  • 27
41
votes
3 answers

Why can't I use Unix Nohup with Bash For-loop?

For example this line fails: $ nohup for i in mydir/*.fasta; do ./myscript.sh "$i"; done > output.txt& -bash: syntax error near unexpected token `do What's the right way to do it?
neversaint
  • 60,904
  • 137
  • 310
  • 477
40
votes
2 answers

How can I see the output console after running a nohup command?

I have a code running on a Linux server. Since it takes hours to run, I have to use nohup to make sure my code is still running in case I loose my connection to the server. Again since I have to wait hours to see the results, I defined a counter to…
MTT
  • 5,113
  • 7
  • 35
  • 61
38
votes
5 answers

How to kill a nohup process?

I executed the following command $ nohup ./tests.run.pl 0 & now when I try to kill it (and the executions that are started from this script) using $ kill -0 it does not work. How can I kill a nohupped process and the processes that…
polerto
  • 1,750
  • 5
  • 29
  • 50
32
votes
1 answer

nohup vs screen -- which is better for long running process?

Background: I have a long running script that makes database schema changes that has output I would want to check after the migration. I would want to write this to a file. I have been reading stack overflow about nohup and screen. I have tried both…
Chris Muench
  • 17,444
  • 70
  • 209
  • 362
26
votes
5 answers

How to constantly run Python script in the background on Windows?

I have created a script that moves files from one folder to another. But since the original folder is the Downloads folder I need it to always run in the background. I also have a standard Batch file that looks something like this: @py…
Thanos Dodd
  • 572
  • 1
  • 4
  • 14
1
2 3
47 48