Pages

Thursday, May 24, 2018

Executing a jar as a background job on Linux

Often I need to leave overnight a long-running Java application. This is done with help of nohup command that blocks SIGHUP signals to the preceeded application and thereby prevents the application from exiting when the terminal session is terminated:

nohup java -jar CopyOracleToMySQL-1.0.jar > copy.out 2>&1 &

The STDOUT and STDERR output is saved to the file copy.out.

No comments:

Post a Comment