nohup does not output log information nohup.out, has been resolved.

Recently springboot used in the project play jar package, run onto the server, in order to prevent close the terminal window causes the program to hang up, using a combination of & nohup command to operate and

Command is as follows:

nohup java -jar test.jar &

But this way the project will start generating a nohup.out default file for logging, and this file takes up too much memory, disk, and file size of a few days, I discovered that there are several G, so in order to reduce the consumption of large quantities of disk, decided to start nohup.out is not output when the project file.

Solutions are as follows:

Only output error messages to a log file 

nohup java -jar yourProject.jar >/dev/null 2>log & 


What message do not 
 

nohup java -jar yourProject.jar >/dev/null 2>&1 & 

 

Guess you like

Origin blog.csdn.net/it_erge/article/details/90799556