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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to automate FTP ...

Status
Not open for further replies.

rostik

Programmer
May 17, 2001
20
US
Please help to automate FTP from Unix server to Windows Client. Is it possible to bypass login and password ?

Thanks in advance.
Rostik
 
You can put the FTP sequence in a file and then put the file in a cron to be run whenever you need it.

Do you know how to do the sequence manually? i.e. ftp open servername username password put filename and so on.

If so, post your request in the -general unix discussion and they will help you.
 
Thanks.
Yes I know all manual steps. However, when I am manually entering to the server, it will ask me login and password. In this case I can enter it. However, how to by pass it if it will be unattended (cron) script????

Rostik
 
You don't bypass it, you manually put it in the batch file whose name you put in the cron.

File something like
connect otherserver username password
put yourfile
logoff

Or similar.
 
It might be possible to use .rhosts files. The .rhosts file is just a file with machinename and user name. Like this
for root:
dengar root
for user:
dengar danne

And so on, always chmod the files 600. that is --rw-------
The .rhosts for root shall be in root's homedirectory and in the users homedirectory. You'll have to create a .rhosts for each user that need to log in transparent.
 
If U have a UNIX FTP server and U login with Win NT machine U can use this,

create a batch file

ftp -i -s:cmnd_file IP_of server

#for more help type ftp -h in WinNT cmd prompt (and I don't know whether this works on Win9x)


then make a cmnd_file with following (with no remarks)

root # user name
pass # pass word
binary # action 1
hash # action 2
cd /http # action 3
.......
mput *
bye # finish


run the batch file and win ftp client will do as U instructed
-------------------------------------------------------

if U have a Windows FTP server and Ur client is UNIX

create a .netrc file in Ur home dirctory with following entries, chmod 700 .netrc

machine IP_of_server
login login_name
password password_of_login


at the cmd prompt just say ftp IP_of_server and Ur logged in. If U want to automate rest of the things too just drop me an e-mail harshana@mailandnews.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top