Questions tagged [nohup]
Run a command immune to hangups, with output to a non-tty.
61
questions
70
votes
5
answers
224k
views
Run a nohup command over SSH, then disconnect
I want to execute a script, start.sh on a remote server which runs this:
nohup node server.js &
Naively, I call SSH like this:
ssh myserver <<EOF
./start.sh &
EOF
This starts the ...
56
votes
2
answers
46k
views
Differences between "<command> & disown" and "nohup <command> & disown"
This is my understanding about the usage of &, disown and nohup:
<command>: runs the process within the Terminal's current bash instance, in the foreground (i.e. the process is listed as a ...
30
votes
5
answers
65k
views
Bring nohup job to foreground
Consider the following nohup execution:
nohup script.sh > script.out &
Is there a way to log off the terminal, reconnect, bring the process back to foreground and interact with it using the ...
19
votes
2
answers
4k
views
What is the function of the nohup command?
I am a newbie in Ubuntu. I have learned a command
nohup [command] - run <command> immune to hangup signal
I can't understand the meaning of "immune to hangup signal". What type of signal it is ...
16
votes
1
answer
13k
views
How can I prevent nohup from creating the file ~/nohup.out?
I use the command $ nohup ... to start an application in the background so that I can close the terminal window afterwards.
Upon execution it creates the file ~/nohup.out.
Example:
orschiro@x230:~$...
8
votes
3
answers
20k
views
How to delete logs automatically after a certain time and restart the process that fills up the log file?
Server is Ubuntu 16.04. I have a process running with nohup that logs into a local file. This file gets big enough to consume 100% disk space. To resolve this I have to kill the process first and then ...
8
votes
4
answers
5k
views
Keep a program running in terminal
So I am well aware of nohup and suffixing commands with & to ensure that they go into the background.
However if I run a graphical application - sometimes using neither seems to do the job. So ...
7
votes
1
answer
25k
views
Cannot install nohup command
I am trying to install the nohup command. When I run sudo apt-get install nohup I get:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to ...
7
votes
5
answers
31k
views
Alternatives to nohup?
I've got an init.d script which I want it to work in the background, even when I quit from the terminal. However I've tried making it run in the background with nohup but had "no hope", ...
5
votes
2
answers
7k
views
Background process (nohup &) suspends/resumes when user logs out/logs in
Ubuntu Server 11.10
When a normal (non-root) user starts a process with nohup (nohup java ... &), when the user disconnects from the terminal (ssh) the process stops responding. When the user ...
5
votes
4
answers
12k
views
How can I start a script in a minimised Gnome Terminal?
I can start a command in a new Gnome Terminal as follows:
nohup gnome-terminal --window-with-profile=Background --command ls >/dev/null 2>&1&
(Based on https://askubuntu.com/a/46630/...
5
votes
1
answer
15k
views
Is there a way to append nohup output file?
I run my script with this command
nohup python a.py > /var/log/a.log 2>&1&
This is okay but every time I run this command /var/log/a.log file is truncated. Is there a way to append ...
5
votes
2
answers
3k
views
How can I fix nohup, byobu, tmux, screen, etc to not die when I disconnect from SSH?
I'm running KDE Neon which is Ubuntu 18.04 Bionic (LTS) with the latest KDE desktop packages on top of it.
Since upgrading to this from Xenial I have lost the ability for processes to survive SSH ...
5
votes
1
answer
5k
views
Launch application via ssh
I am new to SSH. I can connect to a remote computer.
I can also launch an application on a remote computer and see its GUI on my screen.
But I do not know how to launch an application without it ...
4
votes
1
answer
233
views
Is there a utility for hopping in and out of a CLI?
Lets say I've got a bit of server software. I start it up and it provides an interface on stdin/stdout that I can use to enter commands during runtime. I want to be able to start it up over SSH, exit ...
4
votes
1
answer
2k
views
Running a graphical application through ssh and keeping it alive
I want to run a GUI application from a remote client via ssh and keep it alive (and eventually reconnect to it) after the connection is closed.
As an example: I want, from my home pc, to open a ...
4
votes
1
answer
1k
views
How to run a nohup script with upstart?
I'm porting some SysV-style service scripts for HBase (a java service) to upstart.
The sysv scripts don't call java directly, but instead call hbase-daemon.sh. This is a start-stop-daemon-like tool ...
3
votes
3
answers
10k
views
Prevent an application from being closed on terminal exit
I have created a bash script that starts an application. Since I wanted the terminal window to close when the application is started, I used this line:
firefox & 2> /dev/null; exit;
It works ...
3
votes
1
answer
29k
views
Keep running a python program even after logging-off the ssh session [duplicate]
I python script called scrape.py. As the name suggests it is a web crawler and I want it to run continuously on my Linux machine even after I log out and end the ssh session. I read a lot around here ...
3
votes
2
answers
10k
views
Rotate nohup output
I'm working with weblogic 10.3.5 under ubuntu 12.04.
Weblogic is started using
nohup ./startWebLogic.sh >Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer....
2
votes
2
answers
1k
views
Can't I scroll in the terminal up? Terminal shows only 24 rows? The scrollbar on the right fills the entire vertical height of the window?
Based on:
Terminal output scrolling is gone (Headless 11.10 Server, Upgraded from 10.10)
and
https://superuser.com/questions/1331658/why-cant-i-scroll-in-the-terminal
and my own dire situation right ...
2
votes
4
answers
25k
views
Run MySQL Command In Background - nohup
I need to run in background mode some mysql-query...
But how can i do this with nohup?
Standardly i do:
mysql -uroot -p
use SomeDb;
Select * from blablalba;
But how can i do this with launching in db ...
2
votes
4
answers
2k
views
How to short this command?
Every time I need to use sublime to open a project from terminal, I have to do this:
nohup sublime . &
Is there a way to short it?
2
votes
1
answer
9k
views
Where can i get nohup.out, if script starts at startup
test.sh in /root/folder
#!/bin/bash
echo "Hello" #Sample Code
Now in th same folder(/root/folder). I have created nohup_test.sh
#!/bin/bash
while true
do
sh /root/folder/test.sh
sleep 1
...
2
votes
2
answers
2k
views
How to hit Ctrl + C on a terminal so that child terminals do not be closed?
This script opens three terminals, but if I hit Ctrl + C where I run this script, all three child terminals will close too!
File testChildDetach.sh
#!/bin/bash
echo $$
while true; do
nohup xterm -...
2
votes
1
answer
2k
views
How to give input to a script running using nohup?
I have a script running on my server, say test.sh. I executed it using the following command -
nohup test.sh
Now I want to pass an input quit to this script so that it'll terminate itself ...
2
votes
1
answer
2k
views
How to increase maxium number of forks in Ubuntu 16.04 [duplicate]
I am attempting to spin up 1000x Docker containers via:
nohup docker run --rm --name n-$1-$2 n-v2 bash -c "/root/sw/run.sh $1 $2" 2> ~/logs/log-$1-$2.log &
But after about 500x containers I ...
2
votes
1
answer
503
views
When are nohup'd processes stopped during shutdown?
When I shutdown Ubuntu after I started a process using nohup, when and how is it getting stopped?
One of the scripts in /etc/rc0.d/ should handle it, shouldn't? Is it S20sendsigs?
2
votes
1
answer
7k
views
use "nohup &" always get [1]+ Exit 1 after ENTER
Hi I'm using nohup command-name & recently.
My issue is:
When I hit Enter, it will show [1]+ Exit 1. and can't finish the command.
How can I run the second command while I'm running nohup?
2
votes
1
answer
701
views
predefined input in a nohup shell script
I am trying to write a shell script that I can then nohup as it is supposed to run for hours. I am a shell novice so I'm struggling with this a lot.
The script should first open some software (ACE ...
2
votes
0
answers
1k
views
Nohup and input params is this possible?
The following prg requires some input after start in the next line:
./myApp param1 param2 -d /home/user/abc
Enter password:
Is something like this possible:
nohup ./myApp param1 param2 -d /...
2
votes
0
answers
614
views
nohup parallel and rsync out of memory error
I have 10TB of data (around 100Million PDFs) that I'm copying from a Centos box to a new Ubuntu box. I created a script copy-pdfs.sh with this
parallel -j 10 :::: jobs.txt
and started the process ...
1
vote
1
answer
2k
views
How do I get nohup to execute [double-]quoted inner commands?
Let's say I want to run echo nested into watch nested into nohup.
Starting from the bottom of the stack:
echo test
No problems with that.
watch -n 1 'echo test'
watch -n 1 "echo test"
No problems ...
1
vote
1
answer
6k
views
Running Rsync in the background
Trying to run rsync in the background
rsync -rt /home/2/folder/1234 root@12345678:/stor/folder
CTRL-Z
Entering bg
and it runs in the background but now when I exit my SSH connection it stops?
I tried ...
1
vote
2
answers
1k
views
Disown, background, dump to null script
I used to have a script (way back when) that allowed me to execute ANYTHING in terminal and would magically disown and run in the background while dumping any output to null. It may have even nohup'd.....
1
vote
1
answer
2k
views
How to truncate a file that is being written to
I have a long running process on a remote computer which I started like this:
$ nohup ./process > output &
My problem is that the output file is getting bigger and bigger fast. And of course, ...
1
vote
3
answers
14k
views
Using SCP and nohup to transfer large folder between servers
I want to copy a ~50GB folder from one server to another. This is understandably going to take quite a while, so I'd like to be able to perform it "in the background". Using the standard SCP command ...
1
vote
1
answer
2k
views
Some confusion about nohup
Situation1
command
find / -name "*.conf"
Ctrl+Z to pause the process
Situation2
--- hello.sh ---
#!/bin/bash
/bin/sleep 5000
command
./hello.sh &
Situation3
command
nohup ./...
1
vote
2
answers
690
views
Run application nohup-like
Currently I have command pycharm to start Pycharm IDE. I use it like sudo pycharm and this launches Pycharm, but I have to keep terminal from where I've launched it open, because if I close it Pycharm ...
1
vote
0
answers
79
views
Issue with Nohup dying after a few days- running Ubuntu 16.04.4 LTS on Google Compute Engine
I'm running a python script in the background on my virtual machine. The script with nohup works fine for a couple days but the background process seems to die after a few more.
Could Compute Engine ...
1
vote
0
answers
925
views
How to run an interactive python script with nohup
My script requires entering username and password, how do i run it with nohup along with the ability to interact with it at the same time.
1
vote
0
answers
57
views
How to run a script at startup and access it later [duplicate]
I want to run a script at startup that I will need to interact with later. I could find ways to run a script at startup, but no ways to come back to it after it has run. The script never ends. I ...
1
vote
1
answer
907
views
Get GUI back from background application
I started an app (minecraft server) with ssh like this:
nohup java -jar minecraftserver.jar &
and then logged out. Now that I am next to my computer I can't access the server's terminal.
How ...
1
vote
0
answers
256
views
Hide Terminal and still receive input
I want to run a python script that basically uses the terminal for certain commands, but I don't want it to show the terminal. I've tried running the script as nohup file.py & - this works and I ...
0
votes
1
answer
1k
views
How do I schedule a Python script to run in a Linux VM?
I tried using crontab but didn’t work. Also, do I need a nohup to keep it running after exit the SSH connection?
02 19 * * * /usr/bin python3.7 myScript.py
0
votes
2
answers
370
views
the relationship between terminal and the process
Mostly, if I closed the current terminal, the sub_process are also closed. Of course, if I use suspend the process and use `bg JobID wakeup it, the process is divided with the terminal and run in ...
0
votes
1
answer
452
views
nohup can't save the pid of the process into file with xargs command
In the script that I am building I am having problem saving the pid to file.
If run in the terminal the command below:
nohup mvn spring-boot:run > $HOME/logs/app.log 2>&1 & echo $! > $...
0
votes
1
answer
266
views
run a command when a specific folder is empty
I have a python script running which will loop through a folder files (do some work then delete the files there), the folder will eventually get emptied.
I want to run this command when the folder ...
0
votes
1
answer
138
views
users and nohup
How can I tell if there are processes running on a system owned by non-system users?
I thought the users utility command did the trick, but it only seems to track login sessions and not processes ...
0
votes
1
answer
4k
views
Run scripts in background in TTY
There are quite a few questions asking what you can do to run a shell script in the background while not running the terminal. Most have advised to use nohup or disown.
This might be a stupid ...