On this page
FTP: Automate Transfers
Introduction
It’s sometimes convenient to automate certain tasks like uploading files or other operations.
FTP
With the universal ftp command, here’s an example that you can place in a shell script:
transfertFile()
{
inputFile=$1
ftp -n <<end
prompt
open $Hostname $Port
user $Login $Password
ascii
put $inputFile
bye
end
}
NCFTP
With the ncftp utility, it’s even simpler since it works with just one line:
ncftpput -u $LOGIN -p $PASSWORD $ADDRESS DESTINATION-DIRECTORY FILE-TO-UPLOAD
Last updated 22 Jul 2008, 07:30 CEST.