Summary: Simple question ... (getting status)

From: Jim Southerd <jsoutherd_at_bakersfield.com>
Date: Mon Dec 09 2002 - 15:22:17 EST
Well fellow Sun managers, here's a real nice idea I got from John Surveyor,
thank you John.

I never thought of it and it should work real well.

why not use the -v option and direct the output to some log file, then have
the calling script check that log for successful connection and transfer.

Here's a sample

user@mysys /scriptfiles >cat doftp
#!/bin/sh
/scriptfiles/ftptest > /scriptfiles/ftp.log
user@mysys /scriptfiles >cat ftptest
ftp -i -n -v myserver << finish
user anonymous mypasswd
asc
lcd /mydir/subdir
cd /somedir/somesubdir
mput junk.*
bye
finish
user@mysys /scriptfiles >cat ftp.log
Connected to myserver.
220 Myserver Microsoft FTP Service (Version 5.0).
331 Anonymous access allowed, send identity (e-mail name) as password.
230 Anonymous user logged in.
200 Type set to A.
Local directory now /mydir/subdir
250 CWD command successful.
200 PORT command successful.
150 Opening ASCII mode data connection for junk.0.
226 Transfer complete.
200 PORT command successful.
150 Opening ASCII mode data connection for junk.1.
226 Transfer complete.
200 PORT command successful.
150 Opening ASCII mode data connection for junk.2.
226 Transfer complete.
221
user@mysys /scriptfiles >

I did not write the checking script, that would be too imatterial at this
point.

Thank you all for your assistance!

-----Original Message-----
From: Jim Southerd
Sent: Friday, December 06, 2002 10:45 AM
To: Sunmanagers (E-mail)
Subject: Summary: Simple question ... (Correction)


Just thought of trying some...

Found out you can mix mput/mget with put/get as long as the put/get happens
before the mput/mget.

put myfile
mget manfiles.*

-----Original Message-----
From: Jim Southerd
Sent: Friday, December 06, 2002 10:15 AM
To: Sunmanagers (E-mail)
Subject: Summary: Simple question ...


Thanks to all who replied. Guess I was not too far off.
The replies made me think and try things.

What I found is that you can do all sorts of put, get, but you cannot mix
mput/mget with get/put.

And as far as status, no one said it does. Some of the suggestions were
exactly what I'm doing already, putting a status file out there and checking
for it's existence.

Most suggested to use Perl, unfortunately I don't know Perl. I wanted to
learn
it long ago, but life got on the way. Oh, I used Perl before by looking at
other scripts, and I may consider it, but what I'm doing presently is doing
the job.

Some suggested Expect http://expect.nist.gov/  I would rather not load
another
thing on my server.

Again, thank you all for your suggestions.

Here's my original question.

-----Original Message-----
From: Jim Southerd
Sent: Friday, December 06, 2002 8:38 AM
To: Sunmanagers (E-mail)
Subject: Simple question ...


Sorry to ask such a simple question, but I cannot find any dox anywhere on
this.

I am currently running several ftp scripts getting or megetting and putting
files, but I have several scripts each doing one of the above or the other.

What I would like to be able to do is to script more then one function within
a single ftp session. Is that possible?

Does ftp return any kind of a status code so my shell script can tell if the
ftp was successful?

Any direction would be greatly appreciated, thank you!

Jim Southerd    mailto:jsoutherd@bakersfield.com
Progress / Solaris Administrator
Information Services Sr. Systems Analyst
The Bakersfield Californian  http://www.bakersfield.com
661.395.7429 / Fax: 661.395.7696
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Mon Dec 9 15:27:55 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:00 EST