From: Christina.Allain@frx.com
Date: Thu Jun 03 2004 - 11:52:52 EDT
Hello Gurus,
I am writing an automated script that needs to be place in cron job. The
problem with the script is that, I need to log in twice. Does anyone have
similar script? Suggestions are welcome. Thanks in Advance
If I ran the ftp manually it looks like:
ftp -n rest.rest1.com
Connected to rest.rest1.com.
220-FTP authentication :
220
ftp> user test 13now
331-Password:
331
220 narnia FTP server (Version wu-2.6.2+Sun) ready.
ftp> user forestl ttree
331 Password required for forestl.
230 User forestl logged in. Access restrictions apply.
ftp>
When I wrote the script with single user it works fine but with two logins
it failed on the second login. Below is the script:
#!/bin/sh
ftp -n rest.rest1.com << !EOF
user test 13now
sleep 60
user forest1 ttree
cd /outbound
hash
prompt
bin
mget call_sample.txt
mget call_detail.txt
mget header.txt
quit
!EOF
Below is the error from the script:
# ./auto_ftp.scribe.ksh -v
530 Login incorrect.
Login failed.
?Invalid command
Hash mark printing on (8192 bytes/hash mark).
Interactive mode off.
call_sample.txt: No such file or directory.
can't find list of remote files, oops
call_detail.txt: No such file or directory.
can't find list of remote files, oops
header.txt: No such file or directory.
can't find list of remote files, oops
____________________________________________________________________
This e-mail and its attachments may contain Forest Laboratories, Inc.
proprietary information that is privileged, confidential or subject to
copyright belonging to Forest Laboratories, Inc. This e-mail is intended
solely for the use of the individual or entity to which it is addressed. If
you are not the intended recipient of this e-mail, or the employee or agent
responsible for delivering this e-mail to the intended recipient, you are
hereby notified that any dissemination, distribution, copying or action
taken in relation to the contents of and attachments to this e-mail is
strictly prohibited and may be unlawful. If you have received this e-mail in
error, please notify the sender immediately and permanently delete the
original and any copy of this e-mail and any printout.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:28:47 EDT