Install
openclaw skills install obsidian-github-syncAutomated GitHub synchronization for Obsidian vault with conflict detection and notification. Use when the user wants to: - Sync their Obsidian vault to a GitHub repository - Set up automatic daily synchronization - Handle git conflicts in Obsidian vault - Configure git-based backup for Obsidian notes Triggers on phrases like: "sync obsidian", "obsidian github", "vault backup", "sync my notes", "setup obsidian git sync"
openclaw skills install obsidian-github-syncAutomated synchronization of Obsidian vault with GitHub repository using git with conflict detection.
git pull --rebase → commit → pushexport OBSIDIAN_VAULT_DIR="/path/to/your/obsidian-vault"
export GITHUB_REMOTE_URL="git@github.com:username/repo.git"
./scripts/obsidian-sync.sh
# Daily at 3 AM
0 3 * * * /path/to/scripts/obsidian-sync.sh
# Check conflicts at 9 AM
0 9 * * * /path/to/scripts/check-conflict.sh
Main synchronization script. Located at scripts/obsidian-sync.sh.
What it does:
--rebaseEnvironment Variables:
OBSIDIAN_VAULT_DIR (required): Path to Obsidian vaultGITHUB_REMOTE_URL (required): GitHub repository URLGIT_USER_NAME (optional): Git user nameGIT_USER_EMAIL (optional): Git user emailSYNC_LOG_FILE (optional): Log file path (default: /tmp/obsidian-sync.log)CONFLICT_FLAG_FILE (optional): Conflict flag path (default: /tmp/obsidian-sync-conflict.flag)Conflict checking script. Located at scripts/check-conflict.sh.
What it does:
User modifies notes in Obsidian
↓
Cron runs obsidian-sync.sh at 3 AM
↓
Auto-commit local changes
↓
git pull --rebase origin master
↓
git push origin master
↓
Sync complete ✓
Sync runs
↓
pull --rebase fails (remote has divergent changes)
↓
Create conflict flag file
↓
Exit with error
↓
Morning check-conflict.sh detects flag
↓
Notify user
↓
User resolves conflicts manually
↓
Re-run sync
When conflicts occur:
/tmp/obsidian-sync-conflict.flag)cd $OBSIDIAN_VAULT_DIR
git status # See conflicted files
# Edit files to resolve conflicts
git add -A # Stage resolved files
git rebase --continue # Complete rebase
git push origin master # Push resolved state
See references/setup-guide.md for detailed setup instructions including:
# Add sync cron job
openclaw cron add --name "obsidian-sync" \
--cron "0 3 * * *" \
--command "/path/to/obsidian-sync.sh"
# Add conflict check
openclaw cron add --name "obsidian-check" \
--cron "0 9 * * *" \
--command "/path/to/check-conflict.sh"
Create ~/.config/systemd/user/obsidian-sync.service:
[Unit]
Description=Obsidian Vault Git Sync
[Service]
Type=oneshot
Environment="OBSIDIAN_VAULT_DIR=/path/to/vault"
Environment="GITHUB_REMOTE_URL=git@github.com:user/repo.git"
ExecStart=/path/to/obsidian-sync.sh
Create ~/.config/systemd/user/obsidian-sync.timer:
[Unit]
Description=Run Obsidian sync daily at 3 AM
[Timer]
OnCalendar=*-*-* 03:00:00
Persistent=true
[Install]
WantedBy=timers.target
Enable:
systemctl --user daemon-reload
systemctl --user enable obsidian-sync.timer
systemctl --user start obsidian-sync.timer
.gitignore to exclude Obsidian's cache files:# Obsidian
.obsidian/workspace.json
.obsidian/workspace-mobile.json
.obsidian/plugins/*/data.json
.trash/
MIT