Skip to main content

SOP: iCloud Sync (Non-Destructive) — OpenClaw Workspace + Docusaurus KB

Purpose

Make key folders visible from outside the machine by syncing them to iCloud Drive, without risking accidental deletes.

This SOP implements non-destructive one-way sync:

  • local → iCloud
  • no --delete

Scope

  • OpenClaw workspace: /Users/robotics/.openclaw/workspace/
  • Docusaurus KB repo: /Users/robotics/docusaurus-kb/

Safety rules

  • Non-destructive sync only (no mirror mode)
  • Exclude heavy build artifacts (node_modules, build outputs)
  • Use LaunchAgents for periodic sync

Locations (iCloud Drive)

macOS iCloud Drive folder:

  • ~/Library/Mobile Documents/com~apple~CloudDocs/

Targets:

  • Workspace → iCloud Drive/openclaw_workspace/
  • Docusaurus KB → iCloud Drive/docusaurus-kb/

Scripts (source of truth)

These scripts live in your OpenClaw workspace:

  • Workspace sync:
    • /Users/robotics/.openclaw/workspace/scripts/sync-openclaw-workspace-to-icloud.sh
  • Docusaurus KB sync:
    • /Users/robotics/.openclaw/workspace/scripts/sync-docusaurus-kb-to-icloud.sh

How it works (rsync)

Workspace sync exclusions

  • .DS_Store
  • tmp/, tmp_whisper/
  • node_modules/, .next/, dist/, .turbo/

Docusaurus KB sync exclusions

  • .DS_Store
  • node_modules/
  • .docusaurus/
  • build/

Manual run

/Users/robotics/.openclaw/workspace/scripts/sync-openclaw-workspace-to-icloud.sh
/Users/robotics/.openclaw/workspace/scripts/sync-docusaurus-kb-to-icloud.sh

Auto-sync (LaunchAgents)

Plist files created in workspace:

  • /Users/robotics/.openclaw/workspace/scripts/com.arif.openclaw-workspace-sync.plist
  • /Users/robotics/.openclaw/workspace/scripts/com.arif.docusaurus-kb-sync.plist

Enable

mkdir -p ~/Library/LaunchAgents

cp /Users/robotics/.openclaw/workspace/scripts/com.arif.openclaw-workspace-sync.plist \
~/Library/LaunchAgents/

cp /Users/robotics/.openclaw/workspace/scripts/com.arif.docusaurus-kb-sync.plist \
~/Library/LaunchAgents/

launchctl load -w ~/Library/LaunchAgents/com.arif.openclaw-workspace-sync.plist
launchctl load -w ~/Library/LaunchAgents/com.arif.docusaurus-kb-sync.plist

Disable

launchctl unload -w ~/Library/LaunchAgents/com.arif.openclaw-workspace-sync.plist
launchctl unload -w ~/Library/LaunchAgents/com.arif.docusaurus-kb-sync.plist

Verification

  • Check iCloud folders exist:
    • iCloud Drive/openclaw_workspace
    • iCloud Drive/docusaurus-kb
  • Check logs:
    • ~/Library/Logs/openclaw-workspace-sync.out.log
    • ~/Library/Logs/docusaurus-kb-sync.out.log

Rollback

  • Unload LaunchAgents (Disable section)
  • Delete the plists from ~/Library/LaunchAgents/ if desired

Troubleshooting

  • iCloud not syncing: ensure iCloud Drive is enabled in macOS Settings
  • Permission errors: confirm scripts are executable (chmod +x ...)

Changelog

  • 2026-02-14: Initial SOP created.