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.
- Python 3.8+
rcloneavailable on PATH- macOS or Linux (uses
diskutilon macOS for unmounts, falls back toumountelsewhere)
- Install dependencies and make the script executable:
python3 -m pip install --upgrade pip
chmod +x mount_rclone.py- Ensure
connections.tsvis present (see format below) or point to another file with--tsvor env varRCLONE_CONNECTIONS_TSV. - List connections:
./mount_rclone.py list- Mount a connection (runs as a daemon by default):
./mount_rclone.py mount hcc-data-dev- Check status:
./mount_rclone.py status
./mount_rclone.py status hcc-data-dev- Unmount:
./mount_rclone.py unmount hcc-data-dev
# or by explicit path
./mount_rclone.py unmount --mount-point ~/mnt/hcc-data-devThe 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 toremote(use/for root).default_opts: default rclone flags, split with shell rules (e.g.,--vfs-cache-mode=full).
list— print available connection names.status [name]— show mount status for all or one connection (detects viamountoutput).mount <name>— mount using defaults; overrides:--mount-pointto change local mount point--remote-dirto change remote path--foregroundto run in foreground instead of daemon--opt(repeatable) for extra rclone flags--dry-runto print the command only
unmount [name]— unmount by name (uses default mount point) or--mount-point;--forceusesumount -ffallback on macOS;--dry-runprints only.
- The tool aborts if a mount point already appears mounted.
- Paths are expanded for
~and env vars. - Use
--optto pass flags like--log-file /tmp/rclone.logor--vfs-cache-max-age 24h. - For multiple TSVs, set
RCLONE_CONNECTIONS_TSVor pass--tsv /path/to/file.tsv.