FAQ
Dear Friend

I recommend strongly use scp with shared authorized key (ssh
configuration).

It's safe and better!

Any doubt, reply.

Cheers
On Tue, Apr 5, 2011 at 4:43 PM, Vordos, Suzy wrote:

If you must use ftp rather than scp -- then look into using the .netrc
file (man netrc). The login, passwd and ftp commands can be stored in
.netrc as a macro, then executed via shell script. .netrc lives in $HOME
of the user executing the script and must be 600.

-- .netrc
machine login password
macdef mymacro
cd
put $1

-- shell
print "$ mymacro myfile "| ftp -v ${FTP_SYSTEM} > ${FTP_LOGFILE}
if grep "^250 Transfer complete" ${FTP_LOGFILE} >/dev/null 2>&1 ||
grep "^226 Transfer complete" ${FTP_LOGFILE} >/dev/null 2>&1; then
"success"
else
"fail"
fi





------------------------------
*From:* oracle-l-bounce_at_freelists.org [mailto:
oracle-l-bounce@freelists.org] *On Behalf Of *Alex List
*Sent:* Tuesday, April 05, 2011 1:41 PM
*To:* Oracle I List
*Subject:* Shell script to call FTP [off-topic]

Hi,

Sorry for posting an off-topic email, but I guess that my simple doubt is
really simple to you guys.

In my shell script to transfer files, I am having difficult to do the way
I need.
Basically when I invoke the shell, it supposed to log in on FTP server with
password authenticated and so execute the ftp commands.

############
ftp ftp://backup:bkp123_at_10.1.1.25 << _EOF_ >>/dev/null 2>&1
bin
prompt
cd /srv43
lcd /db/bugtracker/
mput *.gz
quit
_EOF_
############

However, when I try to execute I get error like: unknown host

Do you have a suggestion what I am doing wrong??
This same script needs to run on Linux64/bash and AIX.

Thank you in advance for any clue.
Alex

------------------------------
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
--
______________
Atenciosamente
Waldirio
msn: waldirio_at_gmail.com
Skype: waldirio
Site: www.waldirio.com.br
Blog: blog.waldirio.com.br
LinkedIn: http://br.linkedin.com/pub/waldirio-pinheiro/22/b21/646
PGP: www.waldirio.com.br/public.html

--
http://www.freelists.org/webpage/oracle-l

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 8 of 8 | next ›
Discussion Overview
grouporacle-l @
categoriesoracle
postedApr 5, '11 at 5:40p
activeApr 6, '11 at 1:33a
posts8
users5
websiteoracle.com

People

Translate

site design / logo © 2022 Grokbase