服务器上部署 jar 包
1 | nohup java -jar xxx.jar --spring.profiles.active=prod > xxx.log & |
出现警告提示
1 | nohup: ignoring input and redirecting stderr to stdout |
解决办法
1 | nohup java -jar xxx.jar --spring.profiles.active=prod > xxx.log 2>&1 & |
2> :表示把标准错误重定向,标准输出是 1
尖括号后面可以跟文件名,或者 &1,&2,分别表示重定向到标准输出和标准错误
2>&1
1>&2
2>xxx.log
1>xxx.log