This is probably not best way to “sync” a folder.. but it does the job.

sudo apt-get update
sudo apt-get install build-essential libfuse-dev fuse-utils libcurl4-openssl-dev libxml2-dev mime-support
wget http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz
tar xzvf s3fs-1.61.tar.gz
cd s3fs-1.61/
sudo ./configure
sudo make
sudo make install
sudo vim /etc/fuse.conf/

And uncomment the following line in the conf file:

#user_allow_other

Add pare of you Amazon account key id and account access key to /etc/passwd-s3fs file

Edit file /etc/passwd-s3fs and add here string: AWS_ACCESS_KEY_ID:AWS_SECRET_ACCESS_KEY
Where: AWS_ACCESS_KEY_ID — your amazon account key id
AWS_SECRET_ACCESS_KEY — your amazon account access key

Set permissions to file
sudo chmod 0600 /etc/passwd-s3fs    
Mount s3 bucket to local filesystem
sudo s3fs your_backet_name -o use_cache=/tmp -o allow_other /mnt/s3storage

That’s all and now S3 bucket can be used as local filesystem.

Leave a Reply

Your email address will not be published. Required fields are marked *