我正在尝试使用scp复制空文件,此文件将复制到远程服务器(Windows + SolarWinds SCP / SFTP服务器)中。非空文件没问题。
但是,我有这个日志:
Sending file modes: C0644 0 TEST_1
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Connection to myserver closed by remote host.
Transferred: sent 1712, received 1392 bytes, in 122.4 seconds
Bytes per second: sent 14.0, received 11.4
debug1: Exit status -1
lost connection
或者我无法从命令中返回,我被迫杀死它。
Sending file modes: C0644 0 TEST_1
^C
[user@server ~]$ debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Killed by signal 1.
因此,返回码为1,我的脚本返回错误代码。