I'm trying to transfer .bin files from my Raspberry Pi 2 to an Amazon S3 server using a bash script "connect_ftp_amazon" as follows:
#!/bin/bash
HOST='XX.XXX.XXX.XXX'
USER='my_user'
PASSWD='my_password'
DIR='/s3_folder'
LOCALPATH='/raspberrypi_folder'
ftp -inv $HOST <<EOF
quote USER $USER
quote PASS $PASSWD
cd $DIR
lcd $LOCALPATH
mput *.bin
quit
exit;
EOF
However, when I try to execute it in the terminal window with
chmod a+x connect_ftp_amazon
sudo ./connect_ftp_amazon
I got
ftp: connect: Connection timed out
Not connected.
Not connected.
Not connected.
Local directory now /home/pi/raspberrypi_folder
Not connected.
I guess I'm passing my host and/or user parameters in the wrong format, as it works fine with a Linux server. Could somebody help me to identify what is wrong with my settings?