nohup命令
在服务器上运行脚本,但是发现xshell远程登录退出后,程序就会被杀死。 解决方案如下:将你原本的要执行的代码以如下格式执行 nohup 运行程序命令 & 就是在常规运行前加上nohup,&是后台运行。这样断掉xshell也不会程序中断。 并且程序运行时终端的输出内容保存在生成的nohup.out文件中。 如果想要在后台运行多个程序,nohup指定终端输出到指定文件, 使用命令: nohup 运行程序命令 >output 2>&1 & 举例: nohup ./test.sh & nohup ./test.sh >output 2>&1 & 参考文献: https://blog.csdn.net/qq_29477893/article/details/90290276 https://blog.csdn.net/u012979864/article/details/79607961 https://blog.csdn.net/jiangyu1013/article/details/81476184 来源: CSDN 作者: 风景不在对岸wj 链接: https://blog.csdn.net/u011089523/article/details/104116750