Bash脚本没有输出nohup.out + Jenkins

gjw*_*w80 1 bash nohup jenkins

我有一个bash脚本,我从Jenkins的构建步骤调用.在这个bash脚本中是一个nohup命令,用于在后台调用不同的脚本,例如:

#!/bin/bash
nohup otherScript.sh &
Run Code Online (Sandbox Code Playgroud)

构建步骤完成后,我将转到应该创建nohup.out的路径,但那里什么都没有.关于发生了什么的任何想法?

gar*_*les 6

您应该确保输出进入构建的工作区.这将避免其他目录的权限问题.

nohup otherScript.sh > $WORKSPACE/scriptOutput.txt 2>&1 &
Run Code Online (Sandbox Code Playgroud)