Skip to content

Instantly share code, notes, and snippets.

@takus
Created July 31, 2012 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save takus/3217044 to your computer and use it in GitHub Desktop.
Save takus/3217044 to your computer and use it in GitHub Desktop.
install s3fs
#!/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