SFTP 연결 시 "해당 파일 또는 디렉터리가 없습니다"라는 메시지가 표시되지만 파일이 서버에 있습니다.

SFTP 연결 시 "해당 파일 또는 디렉터리가 없습니다"라는 메시지가 표시되지만 파일이 서버에 있습니다.

저는 알아내려고 노력 중인데, 여러분 중 일부가 이전에 이런 경험을 했는지 알고 싶습니다.

SFTP 스크립트(FTP 이전에 SFTP로 마이그레이션됨)가 있습니다. 클라이언트 서버에 파일을 보낼 때 "해당 파일 또는 디렉터리가 없습니다"라는 메시지가 표시되지만 파일이 켜져 있습니다. 클라이언트 서버. 이전에 FTP에 연결했을 때는 이런 일이 발생하지 않았습니다.

전에 이런 경험을 해본 사람이 있나요? 심지어 상태 0으로 종료하는데도 매우 이상합니다.

debug1: Couldn't stat remote file: No such file or directory
debug1: Couldn't stat remote file: No such file or directory
debug1: channel 0: read<=0 rfd 6 len 0
debug1: channel 0: read failed
debug1: channel 0: close_read
debug1: channel 0: input open -> drain
debug1: channel 0: ibuf empty
debug1: channel 0: send eof
debug1: channel 0: input drain -> closed
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: rcvd close
debug1: channel 0: output open -> drain
debug1: channel 0: obuf empty
debug1: channel 0: close_write
debug1: channel 0: output drain -> closed
debug1: channel 0: almost dead
debug1: channel 0: gc: notify user
debug1: channel 0: gc: user detached
debug1: channel 0: send close
debug1: channel 0: is dead
debug1: channel 0: garbage collecting
debug1: channel_free: channel 0: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 2 clearing O_NONBLOCK
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 4.6 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 0

암호:

물론이죠. 저는 이것을 가지고 있습니다:

 sftp -v -b ${sftp_file} ${username}@${server} > ${tmplog1} 2>&1 > ${tmplog2}
 GetStatus=$?
 if (( $GetStatus != 0 )); then
    if [[ $(grep -c "No such file or directory" ${tmplog1}) > 0 ]]; then
        ErrorMessage="No such file or directory"
    elif [[ $(grep -c "Connection refused" ${tmplog1}) > 0 ]]; then
        ErrorMessage="Connection refused with the server"
    elif [[ $(grep -c "Connection timed out" ${tmplog1}) > 0 ]]; then 
        ErrorMessage="Connection timed out with the server"
    elif [[ $(grep -c "No route to host" ${tmplog1}) > 0 ]]; then
         ErrorMessage="No route to the server."
    else
        ErrorMessage="Unknown Error in transmission  process."
    fi
 fi

감사해요!

관련 정보