Deploy jar package operation in the background

1. Run the jar package in the background, closing the terminal does not affect the running of the jar package

nohup java -jar DAG-1.0.jar > msg.log 2>&1 &

The jar package runs in the background, the log information is entered into the msg.log file, and the error log and correct log are entered into the msg.log.
Adding an ampersand at the end of the command means that the process will be executed in the background, so that it will immediately return to the prompt state, and we can continue to do the following.

2. Run the jar package in the background, and enter the correct log and the wrong log into different files.

nohup java -jar DAG-1.0.jar >> msg1.log 2>>msg2.log &

The correct log is entered into msg1.log, and the wrong log is entered into msg2.log.
Adding an ampersand at the end of the command means that the process will be executed in the background, so that it will immediately return to the prompt state, we can continue to do the following Thing.

Guess you like

Origin blog.csdn.net/qq_27198345/article/details/111319348