×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

ftp shell script problem

ftp shell script problem

ftp shell script problem

(OP)
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

RE: ftp shell script problem

#!/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

RE: ftp shell script problem

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 http://www.ncftp.com .

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


Want the best answers? Ask the best questions!  TANSTAAFL!

RE: ftp shell script problem

(OP)
Thanks guys got it sorted now cheers.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close