Execute executable jar with nohup command

Execute executable jar with nohup command

How to log in to Linux via ssh and start the REST API as an executable jar.

By running it with the nohup command, it will remain started even after logging out via ssh.

nohup java -jar server-0.0.1.jar > log.txt 2> errors.txt < /dev/null &

Runs in the background with &.

If you want to stop it, kill it with kill PID.

ps -ef | grep java
root 32226 1 0 2月22 ? 00:00:34 java -jar server-0.0.1.jar

In this case, it is KILL 32226.

コメント

タイトルとURLをコピーしました