Discussion Locked

Executing Via FTP

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Is there a way to automate an FTP session on a dos/windows system to logon to a UNIX box, dump a file to the Unix box and then kick off an Executable that will process the file? I would like to do it all in one FTP session rather than FTPing in, dump the file, close FTP, telnet in and lauch the file.

Bryan

5 replies

by joematus

No. You can automate the file transfer but you can't execute the file using ftp. You'll have to run a cron job on the box or you you can write a telnet script that uses expect to automate what you want to do. Ftp transfers files...period.

by sprick

Hi, use "r-commands" instead! FTP is designed to transfer files. Its command shell is very limited, except if your Unix admin has opened addional things for you.
Now, as I assume that you have an account on the Unix box, create a .rhosts file containing a line with your Windows boxes host name and your account name in your Unix home directory. This will allow you to use r-commands coming from your PC without having to specify a password.
Then, create a script on your PC, that first copies files via the rcp command to the unix box and then executes commands or scripts via the rsh command.
Use Windows scheduler to execute the script automatically if you prefer this to an interactive call.
For syntax details refer to Unix manpages and Windows 2000 help. Availability of r-commands on Windows may vary dependent on your OS version. Eventually you may have to use third-party software (-> cygwin etc.)

This discussion is closed to new replies.