os2, ibm tcp/ip, FTP and redirected input

4 views
Skip to first unread message

Paul Kent

unread,
Oct 8, 1992, 5:22:02 PM10/8/92
to

hi,

one can "can" ftp jobs by putting the commands in a file. (on unix
one can use a here-document or simply pipe the commands into ftp
using perl, my favorite!)

say i have a file "ftp.dat"

----------------
open host
user paul paul
bin
put file other.file
quit
----------------

then

ftp -n <ftp.dat

automagically executes the FTP for me.

The bummer i am faced with os2 tcpip 1.2.1(refresh) is that he (ftp) seems
to insist on opening the console to acquire the password so i cannot
emded this ftp step inside a larger batch file that runs unattended

You guessed, i am trying to implement a "os2 batch machine" where
a community of HPUX workstations queue os2 command files up and they
get processed on an os2 box and the results returned to the submitee

my "solution" is to

set USER=user
rsh host /path/to/shell.script

where the shell script on the host turns right back around and
does a canned ftp get (my host is HPUX that does allow redirected
input into ftp)

i have two questions.. (only two? i'm sure there will be more)

1) is there a way to have ftp stop the password promting sillyness and
have it read from the file. (i know about netrc but would prefer not
to leave passwords in that file -- the current scheme leaves the
password in clear text only for the duration of the job)

am i stuck with porting a pub-domain ftp client?

2) rsh seems to peg the PULSE meter. the shell.script i execute does a
fair piece of work (you could simulate by having your shell.script
do a "sleep 20") without making any output.

all the while the script is doing something, but not sending characters
back down the rsh socket my os2 gets sluggish... is the RSH in a
busy-loop waiting for data. i tried rsh -n in case there was overhead
with respect to polling the keyboard for characters, but that did not
help either....


3) has anyone ported an rcp client. that would work just as well as
ftp for this job, as i have allready "ZOO-ED" the results all
together so its only one binary file that i need to transfer.

thanks for any tips
Paul.

--

Paul Kent (SQL r&d) " nothing ventured, nothing disclaimed "
ke...@unx.sas.com SAS Institute Inc, SAS Campus Dr, Cary NC 27513-2414.

Ed Costello

unread,
Oct 9, 1992, 4:38:54 AM10/9/92
to
In <BvtnC...@unx.sas.com> ke...@manzi.unx.sas.com (Paul Kent) writes:
>The bummer i am faced with os2 tcpip 1.2.1(refresh) is that he (ftp) seems
>to insist on opening the console to acquire the password so i cannot
>emded this ftp step inside a larger batch file that runs unattended
>
>You guessed, i am trying to implement a "os2 batch machine" where
>a community of HPUX workstations queue os2 command files up and they
>get processed on an os2 box and the results returned to the submitee

It's not clear to me whether you're executing ftp on OS/2 or ftp-ing
to an OS/2 machine. I'm assuming you're executing ftp on an OS/2 machine.

I have a small daemon set up to ftp weather images off an internal server.
To do this I put an entry for the server in my \etc\hosts file:
9.xx.y.zzz server.subdomain.ibm.com weather
^ipaddr ^real name ^alias

Then in my \etc\netrc file I have:
machine weather login anonymous password mcrwe...@costello.mcl.ibm.com macdef
wpics
lcd d:\\pub\\pictures\\weather
cd pub/weather
bin
get current.gif
get wxmap.gif
close
quit
(blank line here)

Notes: the double backslashes are needed (WAD or not, I don't know) in the
lcd command
- this sets up two things:
- automatic login to the machine called weather
- a macro called wpics (invoked as $wpics at an ftp prompt)
The command that I execute in my daemon is:
echo $wpics | ftp weather

Can you set up a netrc like the above or do you have security concerns that
prevent that?

-ed costello
__________________________________________________________________-ed costello
MVS/JES Information Development * Mid-Hudson Valley Programming Lab * IBM E.S.
vnet: costello at pokvmcr3 bitnet: costello@vnet
mpn: e...@costello.mcl.ibm.com internet: cost...@vnet.ibm.com

Reply all
Reply to author
Forward
0 new messages