obsync
Use obsync to sync Obsidian vaults on headless Linux servers. Requires an Obsidian Sync subscription and account credentials.
Setup (once)
- -
obsync login (enter email, password, and optional MFA code) - For headless servers: INLINECODE2
- Optionally set keyring password: INLINECODE3
- Verify: INLINECODE4
Output
- - Default: human-friendly terminal output with colors and spinners.
- Use
--json / -j for JSON output. - Use
--verbose / -v for debug logging.
Common commands
- - Log in: INLINECODE9
- List vaults: INLINECODE10
- Pull vault: INLINECODE11
- Pull and save password: INLINECODE12
- Push local changes: INLINECODE13
- Watch (continuous sync): INLINECODE14
- Install systemd service: INLINECODE15
- Check service status: INLINECODE16
- View service logs: INLINECODE17
- Uninstall service: INLINECODE18
Flags
- -
-p, --password — E2E encryption password - INLINECODE20 — save E2E password to keyring for future use
- INLINECODE21 — enable debug logging
- INLINECODE22 — JSON output to stdout
- INLINECODE23 — path to config file (or
OBSYNC_CONFIG env var) - INLINECODE25 — print version and exit
Notes
- - Requires a valid Obsidian Sync subscription.
- E2E encryption uses AES-256-GCM with scrypt key derivation.
- Pull/push compare files by SHA-256 hash — only changed files are transferred.
- Watch mode uses WebSocket for remote changes and fsnotify for local changes (500ms debounce).
- Large files are handled with 2MB chunked transfers.
- Automatic reconnection with exponential backoff (1s-60s) on connection loss.
- The
.obsidian/ directory (themes, plugins, settings) is synced. - For headless servers without a desktop keyring, use
OBSYNC_KEYRING_BACKEND=file. - For always-on sync on headless servers, enable lingering:
loginctl enable-linger $USER. - Config is stored at
~/.config/obsync/config.json.
obsync
使用 obsync 在无头 Linux 服务器上同步 Obsidian 仓库。需要 Obsidian Sync 订阅和账户凭证。
初始设置(一次性)
- - obsync login(输入邮箱、密码以及可选的 MFA 验证码)
- 对于无头服务器:export OBSYNCKEYRINGBACKEND=file
- 可选设置密钥环密码:export OBSYNCKEYRINGPASSWORD=mysecret
- 验证:obsync list
输出
- - 默认:带颜色和旋转动画的友好终端输出。
- 使用 --json / -j 获取 JSON 格式输出。
- 使用 --verbose / -v 获取调试日志。
常用命令
- - 登录:obsync login
- 列出仓库:obsync list
- 拉取仓库:obsync pull My Notes ~/notes -p e2e-password
- 拉取并保存密码:obsync pull My Notes ~/notes -p e2e-password -s
- 推送本地更改:obsync push My Notes ~/notes -p e2e-password
- 监听(持续同步):obsync watch My Notes ~/notes -p e2e-password
- 安装 systemd 服务:obsync install My Notes ~/notes
- 检查服务状态:obsync status My Notes
- 查看服务日志:journalctl --user -u obsync@.service -f
- 卸载服务:obsync uninstall My Notes
标志参数
- - -p, --password — 端到端加密密码
- -s, --save-password — 将端到端密码保存到密钥环以供将来使用
- -v, --verbose — 启用调试日志
- -j, --json — 以 JSON 格式输出到标准输出
- --config — 配置文件路径(或 OBSYNC_CONFIG 环境变量)
- --version — 打印版本并退出
注意事项
- - 需要有效的 Obsidian Sync 订阅。
- 端到端加密使用带有 scrypt 密钥派生算法的 AES-256-GCM。
- 拉取/推送通过 SHA-256 哈希比较文件——仅传输已更改的文件。
- 监听模式使用 WebSocket 处理远程更改,使用 fsnotify 处理本地更改(500ms 防抖)。
- 大文件采用 2MB 分块传输。
- 连接断开时自动重连,采用指数退避策略(1秒-60秒)。
- .obsidian/ 目录(主题、插件、设置)也会同步。
- 对于没有桌面密钥环的无头服务器,使用 OBSYNCKEYRINGBACKEND=file。
- 对于无头服务器上的持续同步,启用驻留功能:loginctl enable-linger $USER。
- 配置文件存储在 ~/.config/obsync/config.json。