免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1363 | 回复: 7
打印 上一主题 下一主题

一个FTP脚本的问题? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-05-10 14:34 |只看该作者 |倒序浏览
这一段FTP的脚本执行时无法退出.
#!/bin/sh
#
ftp_user="user"
ftp_passord="pass"
ftp -n << END
open 192.168.0.1:21
user $ftp_user $ftp_password
binary
prompt off
cd /backup
put backup.$time.tar
close
END
exit 0;
请教是什么问题?

论坛徽章:
0
2 [报告]
发表于 2006-05-10 14:40 |只看该作者

运行后结果

gFTP 2.0.18rc1, Copyright (C) 1998-2003 Brian Masney <masneyb@gftp.org>. If you have any questions, comments, or suggestions about this program,
please feel free to email them to me. You can always find out the latest news
about gFTP from my website at http://www.gftp.org/
gFTP comes with ABSOLUTELY NO WARRANTY; for details, see the COPYING file. This
is free software, and you are welcome to redistribute it under certain
conditions; for details, see the COPYING file

Username [anonymous]: Password:
Looking up -n
                                             Cannot look up hostname -n: Temporary failure in name resolution
                                                                                                             Waiting 30 seconds until trying to connect again

论坛徽章:
0
3 [报告]
发表于 2006-05-10 22:20 |只看该作者
本版精华有大量该问题的帖子。

论坛徽章:
0
4 [报告]
发表于 2006-05-11 03:39 |只看该作者
原帖由 shitou9000 于 2006-5-10 22:20 发表
本版精华有大量该问题的帖子。

是啊.
但是具体到我的问题,就不太适用了.
并且我最不喜欢的就是这样的回答.没有意义.
如果你觉得你知道答案就应该说出来.
而不是所谓的精华,搜索.
如果说搜索的可以用了我就不会在这里再发贴子了.

[ 本帖最后由 LinuxServer 于 2006-5-11 11:43 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2006-05-11 15:41 |只看该作者
原帖由 LinuxServer 于 2006-5-10 14:34 发表
这一段FTP的脚本执行时无法退出.
#!/bin/sh
#
ftp_user="user"
ftp_passord="pass"
ftp -n << END
open 192.168.0.1:21
user $ftp_user $ftp_password
binary
prompt off
cd ...



user $ftp_user $ftp_password

ftp_passord="pass"  ??????

变量名字错了?

一般自动的ftp是



ftp -i -n  ip <<METO
xxx
METO

论坛徽章:
0
6 [报告]
发表于 2006-05-11 23:18 |只看该作者
原帖由 choki 于 2006-5-11 15:41 发表



user $ftp_user $ftp_password

ftp_passord="pass"  ??????

变量名字错了?

一般自动的ftp是



ftp -i -n  ip <<METO
xxx
METO


谢谢.不是这个问题.
我改了后还是一样的.

论坛徽章:
0
7 [报告]
发表于 2006-05-12 11:55 |只看该作者
man ftp
==========================

  -i      Turn off interactive prompting during multiple file transfers.

  -n      Restrain ftp from attempting auto-login upon initial connection. If
          auto-login is enabled, ftp will check the .netrc (see below) file in
          the user's home directory for an entry describing an account on the
          remote machine. If no entry exists, ftp will prompt for the remote
          machine login name (default is the user identity on the local
          machine), and, if necessary, prompt for a password and an account
          with which to login.



我也不知道啊
拷贝你的到我这边可以运行啊

论坛徽章:
8
摩羯座
日期:2014-11-26 18:59:452015亚冠之浦和红钻
日期:2015-06-23 19:10:532015亚冠之西悉尼流浪者
日期:2015-08-21 08:40:5815-16赛季CBA联赛之山东
日期:2016-01-31 18:25:0515-16赛季CBA联赛之四川
日期:2016-02-16 16:08:30程序设计版块每日发帖之星
日期:2016-06-29 06:20:002017金鸡报晓
日期:2017-01-10 15:19:5615-16赛季CBA联赛之佛山
日期:2017-02-27 20:41:19
8 [报告]
发表于 2006-05-12 12:15 |只看该作者
楼主用的是gftp
用系统原来的ftp试试

/somepath/ftp -n << END
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP