ssh 执行任务的时候,让ssh连接断掉,任务继续执行的方法

[root@wangying ~]# yum install screen
Ctrl+a +d 分离屏幕
[root@wangying ~]# screen
[detached from 3730.pts-0.wangying]
[root@wangying ~]# screen -ls   查看分离的屏幕的个数
There is a screen on:
    3730.pts-0.wangying    (Detached)
1 Socket in /var/run/screen/S-root.

[root@wangying ~]#
[root@wangying ~]# screen -R 3730   切换分离的屏幕

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
[root@wangying ~]#

screen -x 加名字
多屏同步


创建一个新的屏幕
screen -R wangying

在另一个新的ssh登录用户
screen -x wangying 可以连个屏幕同步

猜你喜欢

转载自blog.csdn.net/qq_37194598/article/details/84849055
ssh