Tips & Tricks

Sync Obsidian Vaults

How to sync Obsidian vaults across devices using rclone

Sync Obsidian Vaults with Rclone

You can skip the $8-16/month fee for Obsidian Sync by using rclone with your own cloud storage. This gives you unlimited vaults, works with any provider (Google Drive, Dropbox, OneDrive, etc.), and even adds options for extra encryption.

Plus, it’s just satisfying to own your data workflow.

Basic setup

Configure Your Remote

# Set up your cloud storage
rclone config
# Choose your provider (gdrive, dropbox, onedrive, etc.)
# Follow the setup wizard

Initial Vault Upload

# First time - copy vault to cloud
rclone copy ~/Documents/ObsidianVault remote:ObsidianVault

# Verify it uploaded
rclone ls remote:ObsidianVault

Sync on Other Devices

# On another computer - download vault
rclone copy remote:ObsidianVault ~/Documents/ObsidianVault

# Open in Obsidian

Sync strategies

Manual

#!/bin/bash
# sync-obsidian.sh - Manual sync script

VAULT="$HOME/Documents/MyVault"
REMOTE="gdrive:ObsidianVault"

echo "Choose action:"
echo "1) Pull from cloud"
echo "2) Push to cloud"
echo "3) Bidirectional sync"

read -p "Enter choice (1-3): " choice

case $choice in
    1)
        echo "Pulling from cloud..."
        rclone sync "$REMOTE" "$VAULT" --progress
        ;;
    2)
        echo "Pushing to cloud..."
        rclone sync "$VAULT" "$REMOTE" --progress
        ;;
    3)
        echo "Bidirectional sync..."
        rclone bisync "$VAULT" "$REMOTE" --resync
        ;;
esac

Automated/Scheduled

#!/bin/bash
# auto-sync-obsidian.sh - Runs on schedule

VAULT="$HOME/Documents/ObsidianVault"
REMOTE="gdrive:ObsidianVault"
LOCKFILE="/tmp/obsidian-sync.lock"

# Check if Obsidian is running
if pgrep -x "Obsidian" > /dev/null; then
    echo "Obsidian is running. Skipping sync."
    exit 0
fi

# Check for lock file (prevent concurrent syncs)
if [ -f "$LOCKFILE" ]; then
    echo "Sync already in progress."
    exit 0
fi

touch "$LOCKFILE"

# Perform sync
echo "Syncing Obsidian vault..."
rclone bisync "$VAULT" "$REMOTE" \
    --check-access \
    --max-delete 10 \
    --filters-file "$HOME/.config/rclone/obsidian-filters.txt"

rm "$LOCKFILE"
echo "Sync complete!"
Android with Termux
# Install Termux and rclone
pkg install rclone

# Configure remote
rclone config

# Sync script
#!/data/data/com.termux/files/usr/bin/bash
VAULT="/storage/emulated/0/Documents/ObsidianVault"
rclone bisync "$VAULT" remote:Vault

Mount

# Mount cloud storage
rclone mount remote:ObsidianVault ~/CloudVault \
    --vfs-cache-mode writes \
    --daemon

# Point Obsidian to the mounted folder
# Note: Can be slower, especially with large vaults

Filter configuration

Create ~/.config/rclone/obsidian-filters.txt:

# Exclude system files
- .DS_Store
- Thumbs.db
- desktop.ini

# Exclude Obsidian workspace
- .obsidian/workspace.json
- .obsidian/workspaces.json

# Exclude cache
- .obsidian/cache/
- .trash/

# Include everything else
+ **

Use the filter:

rclone sync ~/Vault remote:Vault --filter-from ~/.config/rclone/obsidian-filters.txt

Encrypted vaults

For sensitive notes:

# Create encrypted remote
rclone config
# name> secret-vault
# type> crypt
# remote> gdrive:encrypted-obsidian
# Set strong passwords

# Sync encrypted
rclone sync ~/SensitiveVault secret-vault:

Best practices

To keep your notes safe, always close Obsidian before syncing. This avoids sync conflicts.

If you use bisync to sync your vaults, you can use the --conflict-resolve, --conflict-loser, and --conflict-suffix flags to handle them automatically in the background. To find any conflicted files in your vault:

find ~/Vault -name "*conflict*" -type f

Maintain regular backups that are separate from your sync process, use --dry-run to preview changes, and monitor your first few syncs closely.

It also helps to keep a document of your setup steps so you can easily add new devices later. Finally, use filters to exclude cache and workspace files as they just clutter up the transfer.

How is this guide?