Skip to content

A simple python wrapper around rclone to make repeated mounts easier

Notifications You must be signed in to change notification settings

jgbaum/mount-rclone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

TSV-driven rclone mount helper

Small Python wrapper around rclone mount that reads connection definitions from a TSV file and provides simple subcommands to list, mount, unmount, and check status.

Requirements

  • Python 3.8+
  • rclone available on PATH
  • macOS or Linux (uses diskutil on macOS for unmounts, falls back to umount elsewhere)

Quick start

  1. Install dependencies and make the script executable:
python3 -m pip install --upgrade pip
chmod +x mount_rclone.py
  1. Ensure connections.tsv is present (see format below) or point to another file with --tsv or env var RCLONE_CONNECTIONS_TSV.
  2. List connections:
./mount_rclone.py list
  1. Mount a connection (runs as a daemon by default):
./mount_rclone.py mount hcc-data-dev
  1. Check status:
./mount_rclone.py status
./mount_rclone.py status hcc-data-dev
  1. Unmount:
./mount_rclone.py unmount hcc-data-dev
# or by explicit path
./mount_rclone.py unmount --mount-point ~/mnt/hcc-data-dev

TSV format

The TSV must contain these headers:

name	remote	default_mount_point	default_remote_dir	default_opts

Example row (see current connections.example.tsv):

my-connection	my-rclone-connection:	~/mnt/my-mount-point	/	--vfs-cache-mode=full

Field notes:

  • name: unique identifier used on the CLI.
  • remote: rclone remote prefix, e.g., labshare:
  • default_mount_point: local path to mount (dirs are created if needed).
  • default_remote_dir: appended to remote (use / for root).
  • default_opts: default rclone flags, split with shell rules (e.g., --vfs-cache-mode=full).

Commands

  • list — print available connection names.
  • status [name] — show mount status for all or one connection (detects via mount output).
  • mount <name> — mount using defaults; overrides:
    • --mount-point to change local mount point
    • --remote-dir to change remote path
    • --foreground to run in foreground instead of daemon
    • --opt (repeatable) for extra rclone flags
    • --dry-run to print the command only
  • unmount [name] — unmount by name (uses default mount point) or --mount-point; --force uses umount -f fallback on macOS; --dry-run prints only.

Tips

  • The tool aborts if a mount point already appears mounted.
  • Paths are expanded for ~ and env vars.
  • Use --opt to pass flags like --log-file /tmp/rclone.log or --vfs-cache-max-age 24h.
  • For multiple TSVs, set RCLONE_CONNECTIONS_TSV or pass --tsv /path/to/file.tsv.

About

A simple python wrapper around rclone to make repeated mounts easier

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages