nohup is a POSIX command to ignore the HUP (hangup) signal.

learn more… | top users | synonyms

263
votes
2answers
76k views

Difference between nohup, disown and &

What is the difference between $ nohup foo and $ foo & and $ foo & $ disown
20
votes
7answers
76k 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 ...
16
votes
3answers
11k 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 right?...
26
votes
4answers
22k views

How to Execute multiple command using nohup

I need to execute multiple commands using nohup. Each command should be executed after the previous command. I used this command as an example: nohup wget $url && wget $url2 > /dev/null ...
3
votes
3answers
518 views

Log to multiple files while process in background (nohoup)

I have bash script that logs to two log files in parallel. echo "$(date) | [STATE] Activating IP forwarding" >> $logsPath$logFileName echo $(date +"%Y-%m-%d %H:%M")","$previousState >> $...
3
votes
2answers
142 views

Order between `nohup`, `&` and redirection?

What is the correct order between nohup, & and redirection, when using together? Why are other orders not correct? For example, $ nohup firefox& &> /dev/null $ nohup firefox &&...
1
vote
2answers
2k 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 & ...
1
vote
3answers
8k views

Using nohup to keep a script running indefinitely

I am very new to Linux and I've only been using it to SSH to my web server using Putty. The issue I am having is this: Basically I've got 2 php scripts. One get_tweets.php constantly listens for ...
17
votes
4answers
9k 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, ...
3
votes
1answer
254 views

What is the difference between letting nohup append to 'nohup.out' and explicitly redirecting it to a file?

Consider the following scenario: tail.sh: #!/bin/bash tail -f test.txt invoke.sh: #!/bin/bash nohup ./tail.sh & invoke_explicitredirect.sh: #!/bin/bash nohup ./tail.sh > out.log & ...
4
votes
3answers
1k views

Why is chromium-browser killed when I close the terminal despite nohup?

This question is old, and I am still not clear about why. Original question in 2014: In a Gnome Terminal tab, I ran $ nohup chromium-browser & But when I close the terminal tab, chromium-...
2
votes
1answer
2k views

How do I Nohup an interactive shell-script?

My Script is having 2 command-line arguments and then just couple of questions, after these questions the script will run for itself, I'm able to pass the command-line argument by just doing, -bash-3....
2
votes
2answers
396 views

stderr gets flushed before stdout, when using file logger

My python code: import sys print "i am a daemon" print "i will be run using nohup" sys.stderr.write("i am an error message inside nohup process\n") When i run the code as python a.py, it shows, i ...
1
vote
0answers
121 views

nohup is not working when called from root folder

When I execute the nohup command from the same folder it's working fine (server.php is used to listen to a port 7070) root@servername:/var/www/html/admin# nohup php server.php & [4] 2803 root@...
1
vote
1answer
36 views

What happens if I don't use & at the end of a nohup command? [duplicate]

What's the difference between nohup foocommand and nohup foocommand &? I understand that & marks the task/job/process as running in the background but does that make it more resilient than ...
0
votes
0answers
45 views

Have I created a daemon successfuly?

In gnome terminal under Ubuntu 14.04 In a tab, I run $ nohup sleep 1000 & &>/dev/null I took note of its pid 20643. Then in another tab, I check the sleep process: $ ps -p 20643 -o ...