Giter Site home page Giter Site logo

mount-hetzner-storage's Introduction

mount-hetzner-storage

How to mount Hetzner storage box

Install sshfs command line

yum install sshfs fuse-sshfs

mkdir /backup

Mount storage box

(this command will prompt for a password, you need to do this for the first time)

sshfs [email protected]:/YUOR-FOLDER  /backup

(In one line)

echo 'YOUR-PASSWORD' | sshfs [email protected]:/YUOR-FOLDER  /backup -o password_stdin,allow_other

Check that your storage is mounted with:

df -hT

How to mount Hetzner storage box Automatically

Edit the script and run it, (be sure that your user and password are ok)

./backup-mount.sh

Place your script in crontab and mount every 3-5 min

How to mount Hetzner storage box Automatically on boot with fstab

To automatically mount storage disk we are using sshpass Install sshpass and mount storage disk command line

yum install sshpass

echo 'YOUR-PASSWORD' > /root/.ssh/host.password

Mounting automatically with fstab is pointless because storage box in Hetzner is unmounted every 5 min of inactivity. However you can run mount -a every 3-5 min

nano /etc/fstab

place in to your fstab file at the bottom:

sshfs#[email protected]:/YUOR-FOLDER  /backup   fuse   auto,ssh_command=sshpass\040-f\040/root/.ssh/host.password\040ssh  0  0

Test it manually

mount -a
df -hT

Done!

12 Dec 2017

mount-hetzner-storage's People

Contributors

dloghis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.