Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在脚本中,我使用 SCP 将大文件复制到另一台主机。
scp -qrp hugefile.txt /opt/perf05/tmp
但是,我们注意到该文件没有被复制。我怀疑这是因为我们在通过网络复制这个巨大的文件时失去了连接。在这种网络断开连接的情况下,scp 命令是否返回任何错误代码,或者是否有任何其他调试方法以找出导致此失败复制的确切原因。提前致谢。
-史蒂夫
scp -v
提供调试信息。
当连接失败或发生任何其他网络错误时,scp 确实返回非零 (>1)。