Skip to main content

A friendly fstab auto-mount script for remote filesystems

Project description

Stabbie 🔪

A friendly fstab auto-mount script for remote filesystems

⚠️ Disclaimer

This is a Work-In-Progress side-project, do not use stabbie with critical data or systems.

✨ Features

  • Discover entries with remote filesystems from the fstab
  • Mount entries when their file server is reachable
  • Unmount entries when their file server is away

✏️ Example situation

  • On your LAN, there is a NAS at 192.168.1.50
  • This NAS exposes NFS shares
  • You have a personnal VPN that connects to your LAN
  • Your fstab specifies mount points and options for the NFS shares
192.168.1.50:/share1 /mnt/share1 nfs x-stabbie,noauto,_netdev 0 0
192.168.1.50:/share2 /mnt/share2 nfs x-stabbie,noauto,_netdev 0 0
192.168.1.50:/share3 /mnt/share3 nfs x-stabbie,noauto,_netdev 0 0

You want to try to mount the shares only when the server is reachable.
So, when you're home or when you connect to the VPN.

You just have to run stabbie when the network status changes to automatically mount or unmount the shares depending on the situation.

🔧 Installation and Usage

Prerequisites

  • Linux environment
  • fstab at /etc/fstab
  • Python 3.11 or newer

fstab structure

Stabbie only mounts and unmounts fstab entries:

Installation

Install using pip, from pypi

pip install stabbie

Install from source, if for some reason you can't use another method

pip install git+https://github.com/GeoffreyCoulaud/stabbie.git

Usage

stabbie needs root privileges to mount and unmount.

Basic usage:

stabbie

You can get an up to date list of arguments from the integrated help:

stabbie --help

📁 Supported filesystem types

  • NFS

Feel free to open an issue or a pull request to add support for more filesystems

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stabbie-1.0.3.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

stabbie-1.0.3-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file stabbie-1.0.3.tar.gz.

File metadata

  • Download URL: stabbie-1.0.3.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for stabbie-1.0.3.tar.gz
Algorithm Hash digest
SHA256 bd9abdde9f5002b7553f7920601e76d72fb7b5537c975b5c5148b626519cecdb
MD5 a2909d1329d9a1f57f8463e4e050f166
BLAKE2b-256 472565d2f7ab7050afa8828d0316a8761ef8894acb85c27dfb252ec9b391219c

See more details on using hashes here.

File details

Details for the file stabbie-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: stabbie-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for stabbie-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c8606349dfd34e18a17f109bd8c031283b65a42b3b8f057fdee44eba77f2ccfc
MD5 11b4b415e685b5d6704cfd5b64149710
BLAKE2b-256 19a295da50fd87124b3ff094d506309cebf377a40f2114308dcd712b6bbf1756

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page