Questions tagged [nohup]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
283 votes
13 answers
99k views

Can I nohup/screen an already-started process?

I'm doing some test-runs of long-running data migration scripts, over SSH. Let's say I start running a script around 4 PM; now, 6 PM rolls around, and I'm cursing myself for not doing this all in ...
ojrac's user avatar
  • 2,933
23 votes
6 answers
59k views

How to run script via SSH that doesn't end when I close connection?

I need to run script, that takes long time to execute, or I just want it to run forever. I can't just SSH to my machine, because when I disconnect it stops running. Is there any way to run script ...
Jakub Arnold's user avatar
  • 1,744
22 votes
7 answers
41k 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?
user2454307's user avatar
17 votes
3 answers
31k 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 ...
Davoud Taghawi-Nejad's user avatar
14 votes
4 answers
75k views

There is any way to run processes in the background in Windows? nohup equivalent for windows

nohup runs a process in the background. There is any equivalent for Windows?
Jader Dias's user avatar
  • 4,735
13 votes
3 answers
30k 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? ...
Chad Harrison's user avatar
10 votes
5 answers
29k views

Using nohup when initial input is required

On a linux system is there any way to use nohup when the process that is being nohuped required input, such as an rsync command that needs a password to be entered but will then run happily on its own?...
DrStalker's user avatar
  • 6,976
9 votes
2 answers
11k views

How do I get nohup.out flushed more often?

On Ubuntu 10.04, I have a long Python program that prints a bunch of output; I run this under "nohup". However, it waits until the end to put all the text in nohup.out. When I run similar programs ...
Paul Hoffman's user avatar
  • 2,224
9 votes
4 answers
26k 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....
Jake Wilson's user avatar
  • 8,834
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: ...
Arash Mousavi's user avatar
7 votes
2 answers
8k views

rotate nohup out file (nohup.log)

is there a 'native' way where i can rotate nohup out file ?
silviud's user avatar
  • 2,687
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 ...
Steve Bennett's user avatar
5 votes
6 answers
6k views

job control and ssh

I can't seem to figure out a decent way to manage jobs over ssh. I want to start a job in an ssh session, logout, log back in, do a fg, check on the job, logout, then repeat the whole process. nohup ...
devin's user avatar
  • 1,256
5 votes
2 answers
12k 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 ...
Euskadi's user avatar
  • 215
5 votes
4 answers
14k views

How do I find out the process id of the backgrounded process?

I've got a command (program) that I'd like to run with nohup and background it. Like nohup command > logfile.txt & How do I find out the process ID? I would like to be able to write the ...
user avatar
5 votes
3 answers
11k 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 ...
userpal's user avatar
  • 613
4 votes
1 answer
19k 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 ...
Reado's user avatar
  • 702
4 votes
4 answers
499 views

Linux process management

I started a long running background-process (dd with /dev/urandom) in my ssh console. Later I had to disconnect. When I logged in, again (this time directly, without ssh), the process still seemed to ...
tanascius's user avatar
  • 389
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 ...
reefine's user avatar
  • 239
4 votes
1 answer
4k views

How can I flush stdout for a process under nohup?

Is there a way to flush the buffer that nohup buffers stdout? From what I read in various places (eg. some place) is that I can modify the behaviour from within my programm. But that would be specific ...
user avatar
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 ...
sorin's user avatar
  • 8,056
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 ...
user300811's user avatar
3 votes
2 answers
5k 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 ...
Alex's user avatar
  • 31
3 votes
2 answers
4k 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 ...
instanceof me's user avatar
3 votes
1 answer
3k views

Can I nohup/resume an existing tar process initiation in a ssh session?

First, if I stop a tar process, will it resume from where it left off or will it have to go through all the directories again (a lot of directories and files). Second, am I correctly "disown"ing this ...
Louis's user avatar
  • 155
2 votes
1 answer
3k views

Nohup linux command waits for an additional return, how do I prevent this?

I'm running the following inside a bash script: nohup java server_program.jar & I want that to start running and go about its merry way. However, for some reason it says that it is ignoring ...
Travis's user avatar
  • 141
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 ...
iamauser's user avatar
  • 349
2 votes
4 answers
2k views

Using nohup on Solaris 10

I need to transfer a large number of files over SFTP (only between Solaris servers) which takes a very long time. I cannot keep my PC on for this duration. I tried: nohup sftp server1 While the ...
anurag  kohli's user avatar
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" ...
Gus's user avatar
  • 127
2 votes
3 answers
644 views

How can I return to nohup after logout?

I'm working on an AIX and cannot install screen but want to use its capabilities. Basically I want to be able to run a session (maybe logout), then the same user but logged in again to be able to get ...
Vladimir's user avatar
  • 179
2 votes
0 answers
3k 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 (...
ADTC's user avatar
  • 153
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 ...
dmonner's user avatar
  • 21
1 vote
3 answers
10k views

can you run a shell command via nohup at later time?

I'd like to run a script at 6pm on a remote server but don't want to wait around to trigger it. I don't want to use cron since it's a one time deal. Can I do something like "nohup myscript &" ...
user41172's user avatar
  • 165
1 vote
2 answers
10k views

terminate a processed launched by nohup

I have loaded debian etch into my NAS and I am trying to use it to routinely extract information from a website. Since there are quite a lot of pages to download, I used the nohup command, like this: ...
lokheart's user avatar
  • 123
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 ...
Ajit Soman's user avatar
1 vote
1 answer
6k 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 ...
ffigari's user avatar
  • 113
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 [email protected] 'nohup sudo /opt/scripts/do-thing.sh arg1 ...
JDS's user avatar
  • 2,608
1 vote
1 answer
5k 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 ...
Akshay Bhasin's user avatar
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 ...
Gabriel Santos's user avatar
1 vote
3 answers
5k views

Virtualbox: prevent a virtual machine to go down after I log out from the consolle I lanched the VM from

I have this problem. I login remotely to a machine with Virtualbox installed by launching: ssh -Y root@virtualbox After that, I launch a Virtual Machine: nohup VBoxSDL --startvm vm1 or nohup ...
user avatar
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 ...
Hemerson Tacon's user avatar
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....
noober's user avatar
  • 111
1 vote
0 answers
931 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. ...
Sebr's user avatar
  • 11
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 ...
bubele's user avatar
  • 11
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 &...
Daniel's user avatar
  • 13
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:/...
arsenal's user avatar
  • 217
0 votes
1 answer
2k 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 &...
George Y's user avatar
  • 530
0 votes
1 answer
6k 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 ...
Kaloyan Pashov's user avatar
0 votes
3 answers
5k views

Run netcat in background on Ubuntu Lucid 10.04

I am trying to do a pg_dump from one server and simultaneously restore at the other server. The command on source server (192.168.3.94): pg_dumpall -v | nc 192.168.3.95 4000 The command on the ...
sayeed's user avatar
  • 1
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 ...
Vic's user avatar
  • 105