How to automate ftp login and file transfer with bash script

Sometime ago I had posted a Korn script to automate FTP login and upload of file on a Unix or Linux computer. The default shell for most Linux servers is bash. I ran into a situation on a VMware ESX server where the only shell available is bash. I had rewrite my script in the bash shell, here it is.

# !/bin/bash
# Andrew Lin
# www.gamescheat.ca
filename=”file-to-upload”
hostname=”remote-ftp-server”
username=”andrew”
password=”secret”
cd /home/mydir
ftp -vn $hostname <

Here is the link to the Kron version of the script http://www.gamescheat.ca/2009/08/06/how-to-automate-ftp-login-and-file-transfer/.

1 comment for “How to automate ftp login and file transfer with bash script

Comments are closed.