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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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