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?
You cannot connect to Amazon S3 with FTP. You have to use S3 protocol.
Use aws s3
or s3cmd
commands.
See Uploading files to S3 account from Linux command line .
Though you can mount S3 bucket to a (Linux) server and setup FTP/SFTP server there. See FTP/SFTP access to an Amazon S3 Bucket .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.