Questions tagged [nohup]

Run a command immune to hangups, with output to a non-tty.

Filter by
Sorted by
Tagged with
0 votes
0 answers
63 views

dynamically port forward for by passing Internet censorship

I want to make SSH port forwarding to solve and bypass censorship. I saw many examples and Youtube but I can't get what I want. Every month I must purchase a new VPS due to an advanced filtering ...
Asghar's user avatar
  • 1
0 votes
1 answer
221 views

How to run "Source file.sql" command from MySQL CLI in the background?

I am currently on Ubuntu 22.04. I have over 30 SQL files that creates new databases and some of them are over 10G. I dont want to import those files into MySQL using "MySQL < File.sql" ...
Raul Chiarella's user avatar
0 votes
0 answers
23 views

nohup in alias has problem "nohup: missing operand" [duplicate]

Hi I was trying to create an alias to run a shell script in background: alias inj=nohup ~/software/idea-IU/bin/idea.sh in my ~/.bashrc But as I type inj in terminal, I got nohup: missing operand error....
wayne's user avatar
  • 101
0 votes
1 answer
259 views

Don't kill remote script when local caller process gets killed

Problem I call a long running process via ssh. And it's necessary that this process will not be killed. The user may kill the initial process on its host and I cannot do anything about it. How to make ...
Michael's user avatar
  • 361
1 vote
1 answer
4k 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 ...
tryinghard2's user avatar
0 votes
1 answer
424 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 $! > $...
Rando Shtishi's user avatar
0 votes
0 answers
350 views

capture process ID of nohup in crontab

How can I capture and store the process ID of a nohup command that run in crontab? this is my cron 35 * * * * cd /home/ubuntu/aws/&&nohup python3 upload_s3.py >> output_upload_occ.txt ...
User19's user avatar
  • 165
0 votes
1 answer
191 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 ...
wishmaster's user avatar
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 ...
jindan's user avatar
  • 193
6 votes
1 answer
22k 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 ...
An Ignorant Wanderer's user avatar
0 votes
1 answer
2k views

run continuous ping at startup

I'd like to have a script running in the background, which pings a remote host every 10 seconds or so. The script looks something like this: nohup ping -i 10 www.google.com & I'm able to ...
ether_joe's user avatar
  • 1,053
5 votes
2 answers
2k 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 ...
ironstorm's user avatar
0 votes
0 answers
371 views

nohup works only for a few minutes after logout

I connect to a remote server via SSH. And I want to run a php program in the background on the server after I log out. I have tried using "nohup", but the program only works for a few minutes and then ...
Tao Hu's user avatar
  • 1
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
Marcelo Gazzola's user avatar
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.....
Falcor's user avatar
  • 11
8 votes
3 answers
17k 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 ...
DEVCNN's user avatar
  • 183
0 votes
2 answers
974 views

Running a process through SSH command and keeping it alive

I try running a python program on a remote server using nohup as explained in: How to keep processes running after ending ssh session? When I do ssh server -C "nohup prog.py &", the python ...
Elad Weiss's user avatar
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, ...
Mehran's user avatar
  • 1,657
1 vote
0 answers
64 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 ...
jwright's user avatar
  • 11
2 votes
0 answers
914 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 /...
ssssstut's user avatar
  • 609
1 vote
0 answers
872 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.
amodi's user avatar
  • 11
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 ...
coding_ninza's user avatar
0 votes
0 answers
1k views

How to find out what process I've created with nohup and kill it?

I ran this command: nohup python3 crawler.py > out.txt And I forgot to specify PID at the end of it! Now how can I find out if it's actually running and how can I kill it?
yukashima huksay's user avatar
0 votes
1 answer
976 views

'nohup' command is not working with 'watch' command

I have tried to run nohup watch -n 5 python3 main.py & but it is not working anymore. Is there any way to run watch -n 5 python3 main.py & command in background?
Bangladesh 71's user avatar
2 votes
1 answer
478 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?
Jack Miller's user avatar
3 votes
1 answer
26k 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 ...
Krishnang Dalal's user avatar
0 votes
0 answers
1k views

Using the command nohup for matlab

I would like to launch a matlab script in the background on a remote server by using the command nohup. When I type the command line: nohup matlab MyFile.m outfile.txt & I can't find the .mat ...
mja's user avatar
  • 11
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 ...
CaffeineAddiction's user avatar
2 votes
0 answers
562 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 ...
Chris M's user avatar
  • 143
1 vote
3 answers
13k 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 ...
clb's user avatar
  • 161
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:~$...
orschiro's user avatar
  • 13k
0 votes
1 answer
133 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 ...
Meteorhead's user avatar
2 votes
1 answer
6k 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?
mapping's user avatar
  • 43
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 ./...
Sung Qee's user avatar
  • 113
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 ...
kjr1995's user avatar
  • 111
2 votes
1 answer
683 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 ...
stas g's user avatar
  • 123
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 ...
Veerendra K's user avatar
1 vote
1 answer
820 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 ...
MJ Galram's user avatar
  • 163
3 votes
2 answers
9k 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....
tweetysat's user avatar
  • 391
56 votes
2 answers
45k 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 ...
kos's user avatar
  • 35.6k
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 ...
kos's user avatar
  • 35.6k
7 votes
5 answers
29k 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", ...
3kstc's user avatar
  • 319
1 vote
2 answers
671 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 ...
micgeronimo's user avatar
1 vote
0 answers
238 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 ...
Skyler Blumer's user avatar
5 votes
4 answers
11k 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/...
lofidevops's user avatar
  • 20.5k
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 ...
dayuloli's user avatar
  • 7,275
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 ...
previous_developer's user avatar
4 votes
1 answer
229 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 ...
AdamSpurgin's user avatar
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 ...
phs's user avatar
  • 309
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 ...
GabrielF's user avatar
  • 655