Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp shell script problem

Status
Not open for further replies.

livestrong

Technical User
Nov 27, 2006
29
IE
Hi Everyone

This is my 1st attempt at writing an automated ftp script
and im kinda stuck atm

Code:
#!/bin/sh

ftp -n ftp.open-range.com
quote user <myuser>
quote pass <mypass>

i understand that -n restrains ftp from running through the normal process of logging in thus allowing us to pass the username and pass.

However my problem is when i run the above script and the try to run a command "dir"

i get the following message from the ftp server :

[myuser@myserver ~]$ ./open-range.sh
Connected to ftp.open-range.com.
220 BulletProof FTP Server ready ...
500 Unknown command.
500 Unknown command.
KERBEROS_V4 rejected as an authentication type
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
530 Please login with USER and PASS first.
Passive mode refused. Turning off passive mode.
530 Please login with USER and PASS first.
ftp: bind: Address already in use


Any ideas???

Thanks
 
#!/bin/sh
ftp -n localhost <<!
quote user YourUserName
quote pass YourPassword
binary
put file1 file2
quit
!
This is totally automated. Once it does what it is programmed to do, it disconnects. Hope this helps
 
When I am automating an FTP script, I am nearly always attempting to place a file on a server or fetch a file from a server. I rarely have to check directory information or whatnot.

I have found that instead of trying to automate the several steps it takes to make the general ftp app do the job, I use special-purpose apps like ncftpput and ncftpget, available for multiple platforms at .

If you only have to fetch files, wget is installed by default on most systems.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top