* Help - I'm stuck in FTP and I can't get up
@ 1998-01-30 5:00 Andrew Butchart
[not found] ` <6b1ori$l1k@eliot.oit.umass.edu>
1998-02-09 5:00 ` Kylan Coghlan
0 siblings, 2 replies; 6+ messages in thread
From: Andrew Butchart @ 1998-01-30 5:00 UTC (permalink / raw)
I am trying to set up an automated process that will, while processing a
shell script, ftp the results to the NT server from the alpha running Dec
Unix.
I have the NT server all set up for ftp, it has a listing in the hosts file
and I can manually ftp the file all day long with no problems.
I have read and re-read the man entry on ftp and I cannot see how I can
automate the process. I have tried to use tftp but I think it is more
confused that I am.
There must be a way to do this, but I just can't find it.
Thanks in advance for your help.
Andrew Butchart
abutchar@log.on.ca
http://gb.log.on.ca/abcweb/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help - I'm stuck in FTP and I can't get up
[not found] ` <6b1ori$l1k@eliot.oit.umass.edu>
@ 1998-02-02 5:00 ` Phil Farrell
1998-02-03 5:00 ` Mark Bartelt
1998-02-03 5:00 ` Nick Dokos
1998-02-08 5:00 ` Cameron Laird
1 sibling, 2 replies; 6+ messages in thread
From: Phil Farrell @ 1998-02-02 5:00 UTC (permalink / raw)
To: abutchar
Peter deFriesse wrote:
>
> Somewhere off the top of my screen in article <6atsao$imb$1@newsbell.bellglobal.com>,
> the esteemed abutchar@log.on.ca said:
>
> }I am trying to set up an automated process that will, while processing a
> }shell script, ftp the results to the NT server from the alpha running Dec
> }Unix.
>
> As it always is with UNIX, there is no *one* right way to do this;
> there are several. This is one of them:
>
> #!/bin/sh
>
> ftp -n somehost << END__HERE
> user username password
> [ ftp commands here]
> quit
> END__HERE
>
> Two notes: You would want to keep this file PRIVATE since
> there is a valid username/password in it. Also note that the
> "END__HERE" string (called "hear document") at the end must
> not be intented; start in column one.
This kind of script generally does not work well because the commands are fed
to ftp without waiting for any responses. Ftp may or may not correctly queue
up the commands and execute them. I prefer a shell script that explicitly
waits between commands by using a subshell to echo the commands to a pipe into
the ftp program, e.g,
#! /bin/sh
(echo "user username password"; sleep 15; echo "cd directory"; \
sleep 15; echo "put file"; sleep 15; echo "quit" ) | ftp -n somehost
You would adjust the "sleep" times (in seconds) so they will be long enough to
encompass any delay that might occur on your systems or network.
--
Phil Farrell, Computer Systems Manager
Stanford University School of Earth Sciences
farrell@pangea.stanford.edu
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help - I'm stuck in FTP and I can't get up
1998-02-02 5:00 ` Phil Farrell
1998-02-03 5:00 ` Mark Bartelt
@ 1998-02-03 5:00 ` Nick Dokos
1 sibling, 0 replies; 6+ messages in thread
From: Nick Dokos @ 1998-02-03 5:00 UTC (permalink / raw)
I think "expect" is a better solution for such tasks
(non-interactive use of interactive programs).
It can be found at ftp://ftp.cme.nist.gov/pub/expect/.
Don Libes (expect's author) has published a lot of
articles about using expect to "cure those uncontrollable
fits of interaction" - they can be found in the doc subdirectory
of the above URL.
Nick Dokos
dokos@tuxedo.enet.dec.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help - I'm stuck in FTP and I can't get up
1998-02-02 5:00 ` Phil Farrell
@ 1998-02-03 5:00 ` Mark Bartelt
1998-02-03 5:00 ` Nick Dokos
1 sibling, 0 replies; 6+ messages in thread
From: Mark Bartelt @ 1998-02-03 5:00 UTC (permalink / raw)
Newsgroups: comp.unix.osf.osf1
Subject: Re: Help - I'm stuck in FTP and I can't get up
References: <6atsao$imb$1@newsbell.bellglobal.com> <6b1ori$l1k@eliot.oit.umass.edu> <34D6159B.3B45@pangea.stanford.edu>
Organization: Canadian Institute for Theoretical Astrophysics
Reply-To: mark@cita.utoronto.ca
[ Phil Farrell ]
>> This kind of script generally does not work well because the commands are fed
>> to ftp without waiting for any responses. Ftp may or may not correctly queue
>> up the commands and execute them. I prefer a shell script that explicitly
>> waits between commands by using a subshell to echo the commands to a pipe into
>> the ftp program, e.g,
>>
>> #! /bin/sh
>>
>> (echo "user username password"; sleep 15; echo "cd directory"; \
>> sleep 15; echo "put file"; sleep 15; echo "quit" ) | ftp -n somehost
>>
>> You would adjust the "sleep" times (in seconds) so they will be long enough to
>> encompass any delay that might occur on your systems or network.
Um, rather than kludging around with adjusting "sleep" times to anticipate delays
that are, by definition, unpredicatble, wouldn't it be preferable to use "expect"?
After all, isn't that exactly what it was designed for (i.e. automating the use of
tools which were originally designed to be used interactively)?
Mark Bartelt 416/978-5619
Canadian Institute for mark@cita.utoronto.ca
Theoretical Astrophysics http://www.cita.utoronto.ca/~mark
"Sheep not busy being shorn are busy frying" -- Dylan, at a NZ lamb barbecue
[ singing "It's all right, ma (I'm only bleating)" ]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help - I'm stuck in FTP and I can't get up
[not found] ` <6b1ori$l1k@eliot.oit.umass.edu>
1998-02-02 5:00 ` Phil Farrell
@ 1998-02-08 5:00 ` Cameron Laird
1 sibling, 0 replies; 6+ messages in thread
From: Cameron Laird @ 1998-02-08 5:00 UTC (permalink / raw)
In article <6b1ori$l1k@eliot.oit.umass.edu>,
Peter deFriesse <peter@dev.null> wrote:
>Somewhere off the top of my screen in article <6atsao$imb$1@newsbell.bellglobal.com>,
> the esteemed abutchar@log.on.ca said:
>
>}I am trying to set up an automated process that will, while processing a
>}shell script, ftp the results to the NT server from the alpha running Dec
>}Unix.
.
.
.
> As it always is with UNIX, there is no *one* right way to do this;
>there are several. This is one of them:
Indeed. I'm collecting all I think relevant at <URL:
http://starbase.neosoft.com/~claird/comp.unix.programmer/ftp_automation.html>.
.
.
.
>there is a valid username/password in it. Also note that the
>"END__HERE" string (called "hear document") at the end must
>not be intented; start in column one.
I usually spell that "here".
.
.
.
--
Cameron Laird http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com +1 713 996 8546 FAX
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help - I'm stuck in FTP and I can't get up
1998-01-30 5:00 Help - I'm stuck in FTP and I can't get up Andrew Butchart
[not found] ` <6b1ori$l1k@eliot.oit.umass.edu>
@ 1998-02-09 5:00 ` Kylan Coghlan
1 sibling, 0 replies; 6+ messages in thread
From: Kylan Coghlan @ 1998-02-09 5:00 UTC (permalink / raw)
check out ".netrc". A script file you can create in your home directory
with misc. commands for automated ftp xfers.
Kylan
> I am trying to set up an automated process that will, while processing a
> shell script, ftp the results to the NT server from the alpha running Dec
> Unix.
>
> There must be a way to do this, but I just can't find it.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1998-02-09 5:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-01-30 5:00 Help - I'm stuck in FTP and I can't get up Andrew Butchart
[not found] ` <6b1ori$l1k@eliot.oit.umass.edu>
1998-02-02 5:00 ` Phil Farrell
1998-02-03 5:00 ` Mark Bartelt
1998-02-03 5:00 ` Nick Dokos
1998-02-08 5:00 ` Cameron Laird
1998-02-09 5:00 ` Kylan Coghlan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox