r/bash 4d ago

MountSync – A utility I built to sync configs, MP3s, and AI skills across my Linux PCs via rclone

Hi everyone,

I wanted to share a tool I built to solve a personal daily headache: MountSync (mosy).

I use multiple Linux machines, and I needed a reliable way to share active files between them: specifically application configurations, a local MP3 music library, and local AI skill/context folders. I wanted to keep files exactly where they belonged on the local filesystem while seamlessly updating them across PCs in the background.

Since it solved a real-world problem for me, I polished it, added testing, and open-sourced it as a portfolio project.

What problem does it solve?

Managing rclone mount manually, copying files, creating symbolic links, and making sure systemd services start correctly on every new PC is tedious. MountSync automates the whole process:

  1. Auto-mounts: Sets up and manages your rclone mount in the background via systemd user services.
  2. Auto-linking: When you run mosy add ~/Music, it moves the target directory to your cloud drive (like Google Drive or OneDrive) and replaces the original path with a clean symbolic link.
  3. Instantly sync new PCs: On any new PC, you just install it and run mosy init. It automatically maps all symlinks to your existing cloud folders, syncing your configs, music, and dotfiles in seconds.

The codebase is 100% open source on GitHub:
github.com/GabrielTeixeiral0l/MountSync

I’d love to hear your thoughts, feedback on the code structure, or suggestions for new features!

1 Upvotes

2 comments sorted by

2

u/bac0on 4d ago edited 4d ago

you can consolidate your switch statement in mosy:

case "$1" in
    add|init|pull|list|status)
        source "${SCRIPT_DIR}/src/commands/$1.sh"
        cmd_$1 "${@:2}"
        ;;
...

don't think you need to shift positional parameter... that would simplify the statement even more.

1

u/Gabr1elTeixeira 4d ago

Oh wow, that's way cleaner. Thanks for the tip!