LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1879|回复: 7

如何用一条命令就可以将文件上传到服务器上

[复制链接]
发表于 2008-2-28 15:24:18 | 显示全部楼层 |阅读模式
我記得有條命令叫做ftpput 或者 ftpget ,現在怎麼都找不到,有誰了解嗎

或者用lftp,ftp等命令,可以直接上傳嗎,不要進入ftp 的shell去打命令噢

因為我在腳本中用的
发表于 2008-2-28 15:56:28 | 显示全部楼层
lftp -u user,passwd -e "xxxx;exit"
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-2-28 17:58:56 | 显示全部楼层

还是不行的,你能帮我看看这个命令

lftp -e "cd pub;put io.sh ; exit"  10.2.1.205
回复 支持 反对

使用道具 举报

发表于 2008-2-28 21:08:51 | 显示全部楼层
没看出错误,我这边可以。

lftp -e "debug 3;cd pub;put io.sh ; exit" 10.2.1.205
看有什么错误
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-2-29 16:20:05 | 显示全部楼层
[root@ns1 ~]# lftp -e "debug 3;cd pub;put io.sh ; exit" 10.2.1.205
---- Connecting to 10.2.1.205 (10.2.1.205) port 21
<--- 220 (vsFTPd 2.0.3)
<--- 230 Login successful.      
<--- 250 Directory successfully changed.
cd ok, cwd=/pub
put: Access failed: 553 Could not create file. (io.sh)
回复 支持 反对

使用道具 举报

发表于 2008-2-29 16:42:34 | 显示全部楼层
传文件失败, 是服务器的问题吧.
回复 支持 反对

使用道具 举报

发表于 2008-3-1 16:35:51 | 显示全部楼层
Post by yvqq;1821070
我記得有條命令叫做ftpput 或者 ftpget ,現在怎麼都找不到,有誰了解嗎

或者用lftp,ftp等命令,可以直接上傳嗎,不要進入ftp 的shell去打命令噢

因為我在腳本中用的


在脚本中用Here Document,和命令行一样的:

ftp 10.2.1.205 <<!
user
pwd
put io.sh
bye
!
回复 支持 反对

使用道具 举报

发表于 2008-3-7 11:38:35 | 显示全部楼层
[user@localhost user]$ tftp
tftp> ?
Commands may be abbreviated.  Commands are:

connect         connect to remote tftp
mode            set file transfer mode
put             send file
get             receive file
quit            exit tftp
verbose         toggle verbose mode
trace           toggle packet tracing
status          show current status
binary          set mode to octet
ascii           set mode to netascii
rexmt           set per-packet retransmission timeout
timeout         set total retransmission timeout
?               print help information
tftp>

一般用法就是tftp -i ip get/put file
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表