[ale] How to Automate FTP ????

Bob Kruger bkruger at mindspring.com
Mon May 24 10:12:40 EDT 1999


At 06:22 AM 5/24/99 -0400, you wrote:

>> Hi All,
>>  well this is actually a help i need. I need to automate FTP to  a
>> particular machine from my client an Windows NT
>>  i want to upload data from this NT to a Unix box or an IBM S/390
>> (mainframe) every 5 minutes ,but i am not able to automate the ftp to given
>> IP address say for example i need to FTP data to 123.100.123.12 with a user
>> id of 'xyz' and password 'abcd' with binary mode of transfer and a default
>> directory of 'dir1' in the host. Any ideas??????
>> Thanks.

If I understand what you are driving at, you want to automate the upload
from the NT machine, with the NT machine initiating the session.  If that
is the case, here is a way that I do it daily.

First, write out a batch file to call ftp.  Here is an example:

@ECHO OFF
C:
CD c:\upload
ftp -s:c:\bin\fileput.ftp linuxbox

Note - file c:\bin\fileput.ftp is the ftp script you will run.  linuxbox is
the name of the server.  You will have to substitute names as necessary.

Now, you need to construct your script for using NT FTP.  Try something
like this:

fileput.ftp
---------------------------------------
login
password
hash
prompt
hash
lcd c:\upload
cd /serverdir
binary
mput filename.ext 
bye
quit
exit
----------------------------------
"login" is your linux login.
"password" is the password user "login" uses.
"filename.ext" is the file name you want to upload from NT to the linux box.
The rest is self explanatory.

Make up your own or modify this.  Once this is working properly, use the
task scheduler with NT to schedule for every five minutes.  

I use something similar here at work to move production data to and from
linux/NT machines.  It is as reliable as the software.  Expect the
occasional lockup from NT, although it is rarely as frequent as most
hardcore linuxphiles will tell you.  As for linux, expect it to run
reliably until you reboot it...

If you have any more questions, let me know, and I will be glad to assist.

Regards - Bob Kruger






More information about the Ale mailing list