Computing.Net > Forums > Unix > ftp script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

ftp script

Reply to Message Icon

Name: Andy
Date: June 17, 2003 at 09:37:22 Pacific
OS: Unix
CPU/Ram: ? 1 Gb
Comment:

Hello,
could someone tell me please, how to implement in a script an kind of FTP batch file, which anonymously gives userid and psw and a put and bye command whitin this script.
Thanks in advance



Sponsored Link
Ads by Google

Response Number 1
Name: WilliamRobertson
Date: June 17, 2003 at 10:18:17 Pacific
Reply:

One way:

ftp somehost <<-ENDFTP
ascii
put somefile.dat
bye
ENDFTP

All commands between the "ftp" line and the final label (you can use any convenient label) are passed to the ftp session by the shell after variable expansion etc.

You must have a file named .netrc in your home directory containing entries specifying host/account/password along lines of:

machine somehost login u password p

The .netrc file must be owned by you and not readable by anyone else, i.e:

chmod u=rw,go= .netrc


0

Response Number 2
Name: ORIMON
Date: July 15, 2003 at 10:15:22 Pacific
Reply:


how to put multiple files one per minute.
I do not want ftp calls to be within for do ---done loop so that i do not have to reconnect each time for each file.

please advise.
thanx


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: ftp script

ftp script issue www.computing.net/answers/unix/ftp-script-issue/6675.html

UNIX FTP Scripting www.computing.net/answers/unix/unix-ftp-scripting/5999.html

adding date to ftp script...urgent www.computing.net/answers/unix/adding-date-to-ftp-scripturgent/5355.html