obsync is a lightweight Bash script wrapper for Obsidian on Linux that provides automated, debounced Git syncing for all your vaults.
- Automated Syncing: Automatically commits and pushes changes to your git remote.
- Multi-Vault Support: Discovers all vaults configured in
~/.config/obsidian/obsidian.json. - Debounced Saves: Waits for a cooldown period (default 60s) after the last edit before syncing, preventing excessive commits while typing.
- Pre-Flight Check: Pulls latest changes (
git pull --rebase) on startup to ensure your local vault is up-to-date. - Graceful Shutdown: Performs a final sync when Obsidian is closed.
- Notifications: Sends desktop notifications upon successful syncs.
- Install Helper: Basic installation shortcut creator, so when you run Obsidian, it runs the sync as well.
- Linux environment
gitinotify-tools(for file watching)jq(for parsing Obsidian config)libnotify-bin(fornotify-send)
-
Install dependencies:
sudo apt install git inotify-tools jq libnotify-bin
-
Clone this repository:
git clone https://github.com/mcollard0/obsync.git cd obsync -
Make the script executable:
chmod +x obsync_v1.sh
4a. (Optional) Run installer
bash ./obsync_v1.sh --install
4b. (SuperOptional) Symlink to your path:
bash sudo ln -s $(pwd)/obsync_v3.sh /usr/local/bin/obsync
Simply nstall Obsidian helper in step 4A above or,
Simply run the script instead of launching Obsidian directly to test it out before committing:
./obsync_v1.shThe script assumes your Obsidian configuration is located at ~/.config/obsidian/obsidian.json.
Ensure your vaults are initialized as git repositories and have a remote configured:
cd /path/to/your/vault
git init
git remote add origin <your-repo-url>MIT