0

使用 sftp 获取单个文件时Couldn't canonicalise: No such file or directory出现错误。这就是我正在做的,

#!/bin/ksh
. /feeds/scripts/files.properties

filename=$1.txt

echo $filename  

sftp $getusername@$getserver << EOF >> $logfile

cd /feeds/out/data/

lcd /feeds/files/

get $filename

bye

EOF

我能够打印/回显文件名,但是在执行脚本时我遇到了错误,

user:/feeds/scripts> ./fileReceiver.sh sample
sample.txt
Connecting to xxxxx.xxx.xxx...
Couldn't canonicalise: No such file or directory
Couldn't stat remote file: No such file or directory
File "/u/user/sample.txt" not found.

我不知道为什么它会在文件名前添加“/u/user”。有人可以帮忙吗?提前致谢。

4

2 回答 2

0

解决了!,对不起,我的错误。在属性文件中,我提到了错误的服务器名称。服务器名称看起来非常相似,所以无法弄清楚。无论如何,感谢@devnull,我经历了它,它很有用。

于 2013-11-08T10:47:55.390 回答
0

对我来说,解决方案是在最后从目录名称中删除 /

非工作

/folder-name/

在职的

/folder-name
于 2020-11-20T05:43:36.000 回答