I have mainly used a GUI based FTP program (gftp), but while debugging my website I find it more effective to use FTP in a shell script.
The script I use takes one argument: the file to be transferred.
#! /bin/sh
echo -use a "here" document to embed ftp commands in the script
# Begin of "here" document
ftp <<**
open ftp_site
cd the_target_directory
lcd /.../the_local_source_directory
put $1
bye
# End of "here" document
echo ftp transfer ended
The settings of username, password and destination ftp site must be in the .netrc file in the home directory. The format is as follows:
machine your_ftp_site login your_login password your_passwd
Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer
Add new comment