Batch file to connect to an FTP and put a file


Recently I needed to create a batch file to back up a file on a FTP from another machine. It was not as trivial as might be expected initially, but once you've found out is pretty easy, I put it here in case someone finds it useful.

You just have to create a file with execute permissions containing the following lines:

#!/bin/bash
ftp -n -v xxx.xxx.xxx.xxx << EOT
user username password
prompt
put filename
bye
EOT

Comments

Popular posts from this blog

Installing Firebird ODBC driver on Ubuntu

Installing OCI8 on Ubuntu