Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the nohup on Windows?

Tags:

windows

nohup

I want to run a Java jar file like this:

java -jar spider.jar 

How to run it on the background on Windows?

Like this on Linux:

nohup java -jar spider.jar > /var/tmp/spider.log 2>&1 & 
like image 353
www Avatar asked Aug 01 '10 12:08

www


People also ask

What is nohup equivalent in Windows?

The only way, in Windows, that you can have a process started by a user continue running after logoff (i.e. what "nohup" does) is to start it either through a "scheduled task" or as a Windows service. When the user logs off all processes in their logon session will be killed.

What is nohup used for?

Nohup, short for no hang up is a command in Linux systems that keep processes running even after exiting the shell or terminal. Nohup prevents the processes or jobs from receiving the SIGHUP (Signal Hang UP) signal. This is a signal that is sent to a process upon closing or exiting the terminal.

Do I need nohup?

If you want your running process to be continued without any interruption, then you need nohup command. Nohup (stands for no hangup) is a command that ignores the HUP signal. You might be wondering what the HUP signal is. It is basically a signal that is delivered to a process when its associated shell is terminated.

Where is nohup located?

By default, that file is located in whichever directory you started the command in. nohup. out is somewhat unique because it contains both the standard output and the error output together. nohup redirects both to the same file by default.


1 Answers

You could use the Windows start command:

start /min java -jar spider.jar 

This command is not really the same as nohup; but it might be suitable if you're happy with the Java process running in a separate minimised window. See http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx

like image 68
gutch Avatar answered Sep 20 '22 08:09

gutch