sync-cleo 2026-04-10 12:50
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# Run on Amun or Cleo to set up vault sync
|
||||
AGENT_NAME="${1:-amun}"
|
||||
VAULT_DIR="/root/.openclaw/workspace/obsidian-vault"
|
||||
GIT_REMOTE="${2:-https://github.com/YOUR_GITHUB/obsidian-shared-vault.git}"
|
||||
|
||||
if [ -d "$VAULT_DIR/.git" ]; then
|
||||
echo "[$AGENT_NAME] Vault exists, pulling latest..."
|
||||
cd "$VAULT_DIR"
|
||||
git pull origin master
|
||||
else
|
||||
echo "[$AGENT_NAME] Cloning vault..."
|
||||
git clone "$GIT_REMOTE" "$VAULT_DIR"
|
||||
cd "$VAULT_DIR"
|
||||
git config user.name "$AGENT_NAME"
|
||||
git config user.email "$AGENT_NAME@openclaw"
|
||||
fi
|
||||
|
||||
# Create agent-specific dir
|
||||
mkdir -p "$VAULT_DIR/agent-$AGENT_NAME"
|
||||
|
||||
# Add cron job for 5-min sync
|
||||
(crontab -l 2>/dev/null | grep -v sync-vault; echo "*/5 * * * * /root/.openclaw/workspace/obsidian-vault/sync-vault.sh $AGENT_NAME >> /root/.openclaw/workspace/obsidian-vault/sync.log 2>&1") | crontab -
|
||||
echo "[$AGENT_NAME] Vault setup complete, cron job added"
|
||||
Reference in New Issue
Block a user