#!/bin/bash
# 同步本机 .openclaw/ 到 3.14 主机
# 仅同步"源码"级配置，运行时数据各自保留
set -e

SRC="/home/yangxuan/.openclaw/"
DST="yangxuan@192.168.3.14:/home/yangxuan/.openclaw/"

echo "=== 同步 .openclaw/ 配置到 3.14 ==="

rsync -avz --delete \
  --exclude='.git/' \
  --exclude='sessions/' \
  --exclude='logs/' \
  --exclude='cache/' \
  --exclude='*.bak*' \
  --exclude='state/' \
  --exclude='memory/' \
  --exclude='media/' \
  --exclude='sandboxes/' \
  --exclude='sandbox/' \
  --exclude='openclaw-weixin/' \
  --exclude='credentials/' \
  --exclude='cron/runs/' \
  --exclude='devices/' \
  --exclude='subagents/' \
  --exclude='extensions/' \
  --exclude='delivery-queue/' \
  --exclude='archived/' \
  --exclude='agents-archived/' \
  "$SRC" "$DST"

echo ""
echo "=== 同步完成 ==="
echo "已排除（运行时数据，各自保留）："
echo "  sessions/ state/ memory/ media/ logs/
  cache/ sandboxes/ sandbox/ credentials/ devices/
  openclaw-weixin/ cron/runs/ subagents/
  extensions/ delivery-queue/ archived/ agents-archived/"
