Installation de ncftp
apt-get install ncftp
Envoyer un fichier en une ligne avec la commande ncftpput
ncftpput -m -u $USERNAME -p $PASSWORD $FTPADDRESS /remote/path/ /local/path/filename.sql.gz
Avec la commande ftp (installer par défaut)
ftp -n $FTPADDRESS <<EOF
user $USERNAME $PASSWORD
binary
put /remote/path/filename.sql.gz /local/path/filename.sql.gz
bye
EOF
user $USERNAME $PASSWORD
binary
put /remote/path/filename.sql.gz /local/path/filename.sql.gz
bye
EOF
Avec lftp sur CensOS
lftp -u $USERNAME,$PASSWORD -e "mkdir /remote/path/new; cd /remote/path/new/; mput /local/path/old/*; quit" $FTPADDRESS