嘿所有我已经准备好关于这种类型的问题的许多帖子,但没有任何建议已解决我的问题。也许我错过了什么?我所试图做的是从远程服务器“A” FTP文件并将其保存到本地网络服务器和我计划通过的cron这样外壳脚本为FTP不登录在
我的Cron运行此脚本:
* 1 * * * ./public/xfer.sh > ./public/xferlog.log
我的脚本:
HOST='255.255.255.255'
USER='myadminuser'
PASSWD='supersecretpassword'
ftp -n -v -i $HOST<<EOF
quote USER $USER $PASSWD
lcd /usr/www/xxxx/public/svss/cq
ascii
cd svss
get pbsvss.htm
binary
close
EOF
给了我这些错误..
./xfer.sh: line 4: $'\r': command not found
./xfer.sh: line 14: warning: here-document at line 5 delimited by end-of-file (w')ted `END_SCRIPT
(255.255.255.255)..255.255.255
220 Microsoft FTP Service
Remote system type is Windows_NT.
331 Password required for myadminuser .
530 User cannot log in.
usage: lcd local-directory
200 Type set to A.
530 Please login with USER and PASS.
remote: pbsvss.htm
530 Please login with USER and PASS.
ftp: bind: Address already in use
200 Type set to I.
221 Goodbye.
?Invalid command
您确定它不需要域名,因为它是您登录的Windows系统?像'somedomain/myadminuser' – Difster
稍微偏离主题:为了通过FTP传输文件,我发现使用'ncftp'工具集比直接使用ftp更容易。 – John1024
我确定我不需要域名,因为我可以复制和粘贴每一行,并且工作正常。至于ncftp,不幸的是我在一个共享的主机系统,并没有安装任何其他应用程序/程序的权限。我有ssh访问权限,这就是我测试代码的地方 –