I have a script that gets the following error:
Error
InstanceAgent::Plugins::CodeDeployPlugin::HookExecutor: Script at specified location: scripts/powwow-deploy.sh failed to close STDERR
Script at specified location: scripts/powwow-deploy.sh failed to close STDERR
powwow-deploy.sh
nohup java -jar -Dspring.profiles.active=uat target/pow-wow-0.0.2-SNAPSHOT.jar > logs/nohup.out &
I think the problem is because I am writing the output to nohup.out, i.e. > logs/nohup.out.
How can I make it write to logs/nohup.out without getting the error?
>logs/nohup.outredirects STDOUT. But you also want to redirect STDERR. You could add2>&1to send both STDOUT and STDERR tologs/nohup.out.