Tuesday 27 May 2008

Running ftp commands from a script

Most of the times the things we do from an FTP server will be the same.
  • Login to the ftp server.
  • Navigate to some directory.
  • Change the file type to binary/ascii.
  • Get the file and close the connection.

We can automate the task by doing the following

open ftpserver
username
password
cd /temp
get somefile
bye

Now from the command prompt give ftp-s:Your_file_name and you are done :)

No comments: