在后台运行SCP并监视进度

Tam*_*mas 6 linux scp nohup

scp在后台运行命令:

 nohup scp file.gz root@target-host:/root/ > nohup.out 2>&1
Run Code Online (Sandbox Code Playgroud)

我输入了密码-我ctrl-z按下来中止该命令并使用重新启动它bg,可以通过执行确认它正在运行jobs。但是,有没有一种方法可以监视文件传输的进度(即是否可以在不将其放在后台运行的情况下运行它)?

谢谢。

小智 9

nohup scp <file_name> user@<IP_Address>:<path>
nohup: ignoring input and appending output to 'nohup.out'
user@IP_address's password:
Ctrl+z
bg
disown -h %1
Run Code Online (Sandbox Code Playgroud)

bg -> 将作业发送到后台。

disown -h %1 -> 即使您注销系统,这也会让它运行


小智 0

也许您可以重定向STDERR到文件并用于tail -f 监视它