Skip to content

Instantly share code, notes, and snippets.

@rajeevkannav
Forked from takus/install-s3fs.sh
Created July 29, 2014 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajeevkannav/33258e8fecb8882287f2 to your computer and use it in GitHub Desktop.
Save rajeevkannav/33258e8fecb8882287f2 to your computer and use it in GitHub Desktop.
#!/bin/sh
## Description:
## install script of s3fs
##
## Usage:
## install-s3fs.sh [mountpoint] [bucketName] [accessKeyId] [secretAccessKey]
MOUNT_POINT=$1
BUCKET_NAME=$2
ACCESS_KEY=$3
SECRET_KEY=$4
# install dependent libraries
yum install -y fuse-devel libcurl-devel libxml2-devel
# install in /usr/local/bin
cd /usr/local/src
wget http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz
tar xvzf s3fs-1.61.tar.gz
cd s3fs-1.61
./configure && make && make install
# setup secretkey
echo "$BUCKET_NAME:$ACCESS_KEY:$SECRET_KEY" > /etc/passwd-s3fs
chmod 600 /etc/passwd-s3fs
# mount s3
modprobe fuse
mkdir $MOUNT_POINT
/usr/local/bin/s3fs $BUCKET_NAME $MOUNT_POINT -o default_acl=public-read
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment