是什么导致错误“无法规范化:没有这样的文件或目录"?在 SFTP 中? [英] What cause the error "Couldn't canonicalise: No such file or directory" in SFTP?

查看:50
本文介绍了是什么导致错误“无法规范化:没有这样的文件或目录"?在 SFTP 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 SFTP 将整个目录上传到远程主机,但出现错误.(我知道 SCP 确实有效,但我真的想找出 SFTP 的问题.)

I am trying to use SFTP to upload the entire directory to remote host but I got a error.(I know SCP does work, but I really want to figure out the problem of SFTP.)

我使用的命令如下:(echo "put -r LargeFile/"; echo quit)|sftp -vb - username@remotehost:TEST/

但我收到错误无法规范化:没有这样的文件或目录"无法规范化路径/home/s1238262/TEST/LargeFile"

But I got the error "Couldn't canonicalise: No such file or directory""Unable to canonicalise path "/home/s1238262/TEST/LargeFile"

我以为是访问权限造成的.因此,我以交互模式打开了到远程主机的 SFTP 连接,并尝试在 TEST/中创建一个新目录LargeFile".而我成功了.然后,我使用与上面相同的命令上传整个目录LargeFile".我也成功了.LargeFile 中的子目录是自动创建或复制的.

I thought it was caused by access rights. So, I opened a SFTP connection to the remote host in interactive mode and tried to create a new directory "LargeFile" in TEST/. And I succeeded. Then, I used the same command as above to uploading the entire directory "LargeFile". I also succeeded. The subdirectories in LargeFile were create or copied automatically.

所以,我很困惑.似乎只能在非交互模式下创建 LargeFile/目录.它或我的命令有什么问题?

So, I am confused. It seems only the LargeFile/ directory cannot be created in non-interactive mode. What's wrong with it or my command?

推荐答案

使用 SFTP,您只能在目录存在时进行复制.所以

With SFTP you can only copy if the directory exists. So

> mkdir LargeFile
> put -r path_to_large_file/LargeFile

与@Vidhuran 链接中的建议相同,但这应该可以为您节省一些阅读时间.

Same as the advice in the link from @Vidhuran but this should save you some reading.

这篇关于是什么导致错误“无法规范化:没有这样的文件或目录"?在 SFTP 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆