Questions tagged [nohup]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
25 views

Nohup to run multiple PHP scripts

I have about 5 different PHP scripts that must be run by the server continuously even with the terminal closed. How do I run the 5 scripts once via nohup, each with a log of what it generated, and be ...
  • 235
0 votes
1 answer
3k views

`nohup: failed to run command 'node': No such file or directory` when running script through ssh

I have a remote server in which I serve a webserver using node (express) and nginx. I have a ./devops/deploy.sh script which starts the webserver and restarts nginx. Said script works correctly if I ...
  • 103
0 votes
1 answer
1k views

`nohup` does not work properly with `&&`

I want to make a delayed background execution, for delay I use sleep [anyseconds] && [execution] for background I use nohup Simple example of nohup alone: nohup date &>> out.log &...
  • 410
0 votes
1 answer
93 views

Script for no hangup, time-consuming process that shuts down the machine after finished [closed]

I'm trying to make a script that launches some time-consuming processes detached (using tmux) and also launches a process that works like a sentinel: it looks for the tmux process (in /proc/$(pgrep ...
  • 101
1 vote
0 answers
673 views

Keeping processes alive when closing SSH connection on MobaXTerm

I'm facing somme issue when trying to keep process alive when shutting down session in MobaXTerm. I have a java process which should run on a linux server. I am using two commands, nohup and screen. ...
  • 11
0 votes
1 answer
71 views

Creating a service on Centos 6 causes it to block on startup display

I'm trying to create a service on Centos 6, but it's executing on the startup console instead of in background, which means it never reaches the user interface - it just hangs on the startup display. ...
0 votes
0 answers
131 views

resume tar command when nohup/screen is not possible

I have a dataset which is quite big - a few petabytes. Untarring it into a new filesystem takes a couple days. The problem is that the server does not allow me to have a process running over 24h - it ...
0 votes
1 answer
2k views

How to use nohup properly within an ssh session invoked by gitlab-runner?

I use gitlab runner's ssh executor to access an embedded device via ssh. I want to run a script there. Basically the script invokes an upgrade routine on the device using dbus. Simple enough, isn't ...
1 vote
1 answer
2k views

nohup multiple sequential commands not logging output

I have a python script (which takes a lot of time to complete the execution) that I need to run several times varying the parameters. And it's executed in a remote machine. For instance and test ...
0 votes
1 answer
657 views

Saving PID in nohup output

I want to save the PID of a nohup process as part of the name of nohup's generated output file. This is going in the right direction, but only works if the process with it's ID is already settled, i....
  • 137
1 vote
2 answers
7k views

Create nohup.out file based on date

I am using nohup command to run a java web server application. This is the command i am using: nohup java -jar WEB-SNAPSHOT.jar & This command will create a nohup.out and my server logs are ...
0 votes
3 answers
2k views

nohup daemon process dies when terminal is close

I'm trying to copy the contents of a remote server to my local computer. Here is the command that I'm using: nohup rsync -chavP -e 'ssh -p 23' --stats user@ipaddress:~/great/stuff /volume1/code > ~...
1 vote
1 answer
2k views

Using nohup on remote SSH script, inside the script itself

I'm trying to use nohup + redirection + background operator ("&") to run a remote script via SSH and disconnect. This works: ssh -n fred@fredbox.local 'nohup sudo /opt/scripts/do-thing.sh arg1 ...
  • 2,558
0 votes
1 answer
5k views

How do I run a program as another user properly with "nohup" and "&" in bash

I have been learning bash and linux administration over the past few months while producing more and more code that needs to run in the background. I would ideally like to run my development system ...
0 votes
1 answer
287 views

Understanding how to foreground a background process correctly [duplicate]

I am wanting to background a long running script, which I know I can do using the following: nohup ./install.sh &>/dev/null & However, I also realize that if I leave that session, I can ...
  • 717
0 votes
2 answers
2k views

How do I install nohup on a QNAP TVS-871T

I'm trying to setup a background job in a QNAP TVS-871T. It doesn't come with nohup pre-installed. I've found multiple references to install it on a QNAP device (e.g. https://stackoverflow.com/...
  • 367
0 votes
0 answers
184 views

Nohup at boot in Debian

I have a Debian server with kernel version 2.6.26-2-686. At boot time it reaches a line `nohup: ignoring input and appending output to 'nohup.out' and then it stops. I can't get to the command ...
4 votes
3 answers
10k views

How to use nohup to continue to run a command after the user logout?

nohup <command> <arg> & When I SSH into a Linux server, if I want to run a command and make sure that it will continue to run in the background after I logout from SSH, I will use the ...
  • 593
1 vote
1 answer
4k views

Nohup stops script after logging out

I have to run a python script in the background in my server. I am using the command: nohup python MyScript.py & in the command line. Now, when after running this I close the connection and log ...
0 votes
4 answers
5k views

Script started with nohup get killed when leave terminal

I need to run some python scripts with infinite loop on ubuntu server (Amazon EC2). And I really like the idea to use nohup as it is simple and I can have output.out log file. I start script like ...
2 votes
0 answers
2k views

Simple progress for rsync when piping output to a log file

I ran rsync with nohup and --progress: nohup rsync --progress --[other-options] source destination & tail -f nohup.out When I'm tailing the file, I see the output with a changing last line (...
  • 153
-2 votes
1 answer
5k views

How to find out reason of python script stop working in background?

I've bought a VDS server some days ago just to have some Telegram Bots working 24/7. I can't keep shell always open, so I've decided to use this "hack": 1. In Python script add #!/usr/bin/python3.4 ...
  • 113
0 votes
1 answer
751 views

Why c app is not writing to nohup.out

I wrote a simple master-slave failover setup for my two servers using c, running redhat6 which using udp heartbeats to monitor one another. In my app I'm printing out some information like, heartbeat ...
  • 1,062
1 vote
0 answers
2k views

How to kill all process on ssh logout? (Kill running Background proccess started with screen etc)

Hi i have a multiuser centos server running. There are for example 3 users (non root) - each of them have their own homedir. SSH Login is allowed (bash). How could it be reached, if a user started ...
  • 11
1 vote
1 answer
4k views

how to run nohup when prompted for password and/or input parameter

I typically use nohup like so: nohup ./myscript.sh 11111 > nohup.out & Where 11111 is an input parameter. In this case, the application is prompting for a password and I'm unable to use nohup....
  • 111
7 votes
1 answer
4k views

rsync termiates after a while unexpectedly

I run a rsync command with nohup in ssh session, but after a while it returns this error: rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(549) [generator=3.0.9] rsync error: ...
0 votes
1 answer
2k views

How to run putty with -m command line *and* get log?

I'd like to launch putty and run my script automatically, it works, but I can't save the logs (I need them to debug)! The way I call putty: "D:\Some-Path\putty\PUTTY.EXE" -t -load "Server - 111.22....
  • 109
0 votes
1 answer
2k views

Rotating a nohup.out logfile

There are a few questions on how to rotate the output file generated by nohup. Most of the answers say to use logrotate with the copytruncate option. However this does not actually work -- when the ...
  • 169
20 votes
7 answers
39k views

how to rotate nohup.out file without killing my application

My nohup.out file is growing fast. I am running an application in the background, it's writing nohup.out file, now I need to rotate nohup.out file without killing my application. Can this be done?
0 votes
1 answer
893 views

nohup.out is no longer being appended

I have a Ubuntu Linux ec2 instance that's running on AWS. I used the following command nohup php script.php so that when I disconnect from the instance with SSH, it still runs. The script contains ...
  • 143
1 vote
1 answer
1k views

Why does my command stop when I exit SSH? [closed]

I am running the following command in a loop (without notable memory leaks) as a cPanel user: nohup php ~/www/app/console.php run clean 1> /dev/null 2> ~/www/logs/run_clean.log & But when ...
0 votes
2 answers
4k views

How to kill the process using the name of the program instead of PID?

I started my Python program in the background using nohup as mentioned below - nohup zook.py & Now I am trying to kill this process so I did the ps command as mentioned below root@phxdbx1145:/...
  • 217
6 votes
1 answer
4k views

nohup vs screen vs ? for manually starting daemon processes

When I need to start a background process on a low-importance server, I tend to use nohup: nohup ./server.sh & Most colleagues seem to prefer screen: screen -D -R mydaemon ./mydaemon.sh ^A ^D ...
1 vote
1 answer
2k views

nohup create multiple process

I am using nohup for the script run inotify command, because inotify stop when I exit from terminal so I want the script to run on background. so I run the script like this nohup /path/to/script.sh &...
  • 13
5 votes
2 answers
11k views

How to run rsync without staying logged in?

I want to run the following rsync command to transfer a folder from a remote server to my current one sudo -r -a -v -e 'ssh -p portnum' username@serverip:/home/path/* /home/path this directory is ...
  • 215
2 votes
3 answers
10k views

how to convert a running process into a nohup and keep a logfile

I have a process currently occupying a terminal ]$ command some_argument I want to exit from the terminal and go home, but in the mean time I don't want to kill this running process. For the ...
  • 349
3 votes
2 answers
3k views

Remote synchronous-then-asynchronous execution with SSH

TL;DR I want to remotely execute a script that begins synchronously (so that the local ssh command fails if the preparatory commands fail) and then goes asynchronous, thus terminating the local ssh ...
3 votes
1 answer
3k views

Move a running process in background and keep it running even if you disconnect

You already have a running process and you want to put it to run in background. If you want to be sure that this will still run after you close you ssh connection, what should you do? Note: you are ...
  • 7,876
2 votes
1 answer
5k views

How do I prevent a nohup process from being killed when ssh connection fails

I'm having an odd problem. I have a server process that gets started with nohup, and persists across logout and re-login just fine. However if I leave myself logged in and then get the "broken pipe" ...
  • 127
4 votes
1 answer
18k views

nohup - no such file or directory

I'm trying to execute the following command on my CentOS 6.3 x64 server: nohup "/usr/local/bin/php -v" The result is: nohup: ignoring input and appending output to `nohup.out' nohup: failed to run ...
  • 702
3 votes
2 answers
4k views

trap "" HUP v.s Nohup ? How can I run a portion of shell script in nohub mode?

I want to run a shell script over the weekend, but I wanna make sure if the terminal loses the connection, my script won't be terminated. I use nohup for the whole script invokation, but I also want ...
  • 31
9 votes
4 answers
25k views

nohup multiple sequential commands

I need to nohup two commands, one after another. The second command has to be executed AFTER the first command. Here are the commands: tar -zcf archive.tar.gz.tmp mydir mv archive.tar.gz.tmp archive....
  • 8,634
16 votes
3 answers
29k views

Redirect nohup to stdout

Is it possible to let a process started with nohup, write to stdout instead of in a file? or maybe in the file and on the screen? nohup python start.py & writes to nohup.out, but I'd like it to ...
13 votes
3 answers
27k views

What does the ampersand (&) symbol mean with `nohup`?

Ive seen tons of examples where a & follows the end of a command string, but I can't seem to find an explanation on what it does. It's not even in nohup's man page. Is this a shell thing? ...
3 votes
1 answer
3k views

reattaching a process started with nohup?

Is it possible to reattach a process started with nohup? For example, start in a terminal: nohup tail -f /dev/null & Close the terminal. Now open a new terminal. How do you reattach the nohup'd ...
0 votes
4 answers
3k views

nohup command on Mac

I connect to some mac machine using SSH and run a command similar to: nohup /var/root/install.sh param1 param2 </dev/null >/var/root/vvv.out 2>&1 & echo '' ; echo ERROR_CODE:$? It ...
  • 95
4 votes
2 answers
5k views

Estimating MySQL Query Runtime

I ran a MySQL query from command line using the following: nohup mysql --user=root --password=XXXXXXXXX database < report.sql > results.tab This query is extensive (5000 lines) and running a ...
  • 239
0 votes
2 answers
1k views

How to run at boot a program that will run until shutdown

I am using Debian (6) and need to run at boot an X server (without a login manager). What is the best way to do this? From what I've read, the usual way is to have a script in /etc/init.d. I created ...
2 votes
1 answer
3k views

Mysterious per-session CPU limiting?

TL;DR: CPU-hungry processes are sharing cores on a multi-core server while other cores sit idle, whereas I expect the Linux scheduler to distribute jobs evenly across cores. What could cause this ...
  • 21
0 votes
1 answer
553 views

Shutdown server in background using PHP

I'm trying to shutdown an Ubuntu machine from PHP and am running into an issue if I want to delay the shutdown. The PHP line I'm using is: exec("sudo shutdown -h +5 &", $output); Where 5 is ...
  • 127