Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
13
rated 0 times [  13] [ 0]  / answers: 1 / hits: 761  / 1 Year ago, thu, january 19, 2023, 3:51:02

We are starting our Jenkins CI with the following bash command that I would like understand. Could someone explain what is doing (the only bit I get is "java -jar jenkins.war"). Thanks!



nohup java -jar jenkins.war > $HOME/jenkins.log 2>&1 < /dev/null &

More From » bash

 Answers
7

The nohup means it will continue to run when you exit the shell.



The > means redirect the standard output to a file



The file it is being redirected to is $HOME/jenkins.log. You can find the value of $HOME by running echo $HOME



2>&1 means redirect standard errors to standard output, so in this example will also go into $HOME/jenkins.log.



The < /dev/null means read data in from /dev/null. So if the script is expecting input it will read that instead of waiting for user input.



And the & means run as a background task, and return you to the command line.



If you want more detail, ask in the comments.


[#40488] Friday, January 20, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ranquctive

Total Points: 391
Total Questions: 103
Total Answers: 104

Location: South Sudan
Member since Thu, Feb 4, 2021
3 Years ago
;