由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - can anyone post a FTP auto get script ?
相关主题
能这样么?新增用户为什么不能login?
FTP HelpHelp!!! Login Problem
question[转载] Hidden character in a file
unix下能支持断点续传的FTP软件 有吗?"#! /bin/csh" != "#!/bin/csh" ??????
用FTP怎么下载带空格的文件?where is the passwd file stored
请问:如何确定wget用的binary方式传递文件?how to use batch file to ftp files in UNIX?
FTP server problem.cshrc file
login shell and normal shell?请教怎样使用tar压文件
相关话题的讨论汇总
话题: ftp话题: script话题: files话题: eof话题: part
进入Unix版参与讨论
1 (共1页)
d***c
发帖数: 13
1
I saw a ftp script before, which could do auto connection and fetch files
from hosts. what I'm interested in is its login part.
But I could not remember how exactly it is written now.
only remember it used something like
...
cat > ftp host << EOF
{ login part with usrname, passwd..}
EOF
....
{ getting files part }
...
does anyone how to do that login part ? thanx !
l*l
发帖数: 225
2
you should using .netrc to config your account. Then:
{
bin
put sth
..
..
} | ftp host

【在 d***c 的大作中提到】
: I saw a ftp script before, which could do auto connection and fetch files
: from hosts. what I'm interested in is its login part.
: But I could not remember how exactly it is written now.
: only remember it used something like
: ...
: cat > ftp host << EOF
: { login part with usrname, passwd..}
: EOF
: ....
: { getting files part }

m******n
发帖数: 497
3
in your script
ftp -n host < user username password
#bin
#prompt
#hash
#getting files
bye
EOF
or you can put them in the $HOME/.netrc as mention above

【在 d***c 的大作中提到】
: I saw a ftp script before, which could do auto connection and fetch files
: from hosts. what I'm interested in is its login part.
: But I could not remember how exactly it is written now.
: only remember it used something like
: ...
: cat > ftp host << EOF
: { login part with usrname, passwd..}
: EOF
: ....
: { getting files part }

b***x
发帖数: 161
4
And you can use expect to do it. A sample expect script /usr/bin/ftp.expect
is doing exactly the task you described.

【在 m******n 的大作中提到】
: in your script
: ftp -n host <: user username password
: #bin
: #prompt
: #hash
: #getting files
: bye
: EOF
: or you can put them in the $HOME/.netrc as mention above

t*********l
发帖数: 30
5
I tried to download several thousands of files from another
machine (in LAN) using expect, but it stoped after no more
than 200 files, then it just stopped. I tried several times,
it always failed. I don't know if expect is not stable or my
script has problem. I just did some change to ftp.expect. If
it has error, it should start work from the very beginning :((
So at last I have to go back to ftp script.

【在 b***x 的大作中提到】
: And you can use expect to do it. A sample expect script /usr/bin/ftp.expect
: is doing exactly the task you described.

w*****g
发帖数: 198
6
1. "mget" in ftp will help you get multiple files, have you tried it?
or get "get" using ncftp, take advantage of wildcards
2. wget -i input, where input is a list of file names
(not very efficient if files are small, since wget logins for each DL)

【在 t*********l 的大作中提到】
: I tried to download several thousands of files from another
: machine (in LAN) using expect, but it stoped after no more
: than 200 files, then it just stopped. I tried several times,
: it always failed. I don't know if expect is not stable or my
: script has problem. I just did some change to ftp.expect. If
: it has error, it should start work from the very beginning :((
: So at last I have to go back to ftp script.

t*********l
发帖数: 30
7
hehe, you think I put get image001001.tif ... image200200tif there?:)
anyway, thanks for your reply.

【在 w*****g 的大作中提到】
: 1. "mget" in ftp will help you get multiple files, have you tried it?
: or get "get" using ncftp, take advantage of wildcards
: 2. wget -i input, where input is a list of file names
: (not very efficient if files are small, since wget logins for each DL)

1 (共1页)
进入Unix版参与讨论
相关主题
请教怎样使用tar压文件用FTP怎么下载带空格的文件?
Korn shell script请问:如何确定wget用的binary方式传递文件?
Help about printing through network!FTP server problem
Help! shell programminglogin shell and normal shell?
能这样么?新增用户为什么不能login?
FTP HelpHelp!!! Login Problem
question[转载] Hidden character in a file
unix下能支持断点续传的FTP软件 有吗?"#! /bin/csh" != "#!/bin/csh" ??????
相关话题的讨论汇总
话题: ftp话题: script话题: files话题: eof话题: part