scp后台运行获取远程服务器文件

执行命令

[root@localhost seafile]# scp root@ip:/var/seafile/shared.tar.gz . root@ip's password: Permission denied, please try again. root@ip's password: Permission denied, please try again. root@ip's password: shared.tar.gz

ctl+z暂停
[1]+已停止scp root@120.77.248.3:/var/seafile/shared.tar.gz .

后台查看jobs,目前是停止运行
[root@localhost seafile]# jobs [1]+已停止scp root@120.77.248.3:/var/seafile/shared.tar.gz .

让scp程序后台运行,bg %{jobid这里是1}
[root@localhost seafile]# bg %1 [1]+ scp root@120.77.248.3:/var/seafile/shared.tar.gz . & [root@localhost seafile]# ps -ef|grep scp root2944514550 15:09 pts/000:00:00 scp root@120.77.248.3:/var/seafile/shared.tar.gz . root29446 294450 15:09 pts/000:00:00 /usr/bin/ssh -x -oForwardAgent=no -oPermitLocalCommand=no -oClearAllForwardings=yes -l root -- 120.77.248.3 scp -f /var/seafile/shared.tar.gz root2953814550 15:10 pts/000:00:00 grep --color=auto scp

查看jobs,目前状态为运行中,已经在后台运行
[root@localhost seafile]# jobs [1]+运行中scp root@120.77.248.3:/var/seafile/shared.tar.gz . &

    推荐阅读