Skip to content

Instantly share code, notes, and snippets.

@ayush--s
Last active June 2, 2020 22:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayush--s/fa40f406771eb36ed90e7fc52b7ec7aa to your computer and use it in GitHub Desktop.
Save ayush--s/fa40f406771eb36ed90e7fc52b7ec7aa to your computer and use it in GitHub Desktop.
S3FS setup with systemd
sudo apt install s3fs
echo "<redacted>" > ~/.passwd-s3fs
sudo nano /etc/systemd/system/s3fs.service
chmod 600 /home/ubuntu/.passwd-s3fs
sudo systemctl daemon-reload
sudo systemctl enable s3fs
[Unit]
Description=s3fs
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/s3fs <bucketname> /home/ubuntu/data -o retries=4,use_cache=/home/ubuntu/.cache/s3fs,max_stat_cache_size=8000,endpoint="ap-south-1"
User=ubuntu
Group=ubuntu
WorkingDirectory=/home/ubuntu
ExecStop=/bin/fusermount -u /home/ubuntu/data
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment