Files
the-custodian/tools/migrate-working-memory-pvc-to-clone.sh
codex ac0886a409 feat(T06): complete sink path decoupling and working-memory sweep sync
hostPath working-memory on railiance01, migration tool, sweep commits
daily-triage notes; T06 marked done in workplan.
2026-07-07 01:01:26 +02:00

24 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# One-time migration: copy activity-core PVC daily-triage notes into the
# railiance01 the-custodian clone so consistency sweep can commit them.
set -euo pipefail
KUBECONFIG="${KUBECONFIG:-$HOME/.kube/config-hosteurope}"
CLONE_DIR="${CLONE_DIR:-/home/tegwick/the-custodian/memory/working}"
NAMESPACE="${NAMESPACE:-activity-core}"
echo "=== Source: actcore-worker PVC mount (legacy) ==="
KUBECONFIG="${KUBECONFIG}" kubectl -n "${NAMESPACE}" exec deploy/actcore-worker -- \
sh -c 'ls -1 /var/custodian/memory/working/daily-triage-*.md 2>/dev/null | wc -l' || echo "0"
echo "=== Copying daily-triage notes to ${CLONE_DIR} ==="
KUBECONFIG="${KUBECONFIG}" kubectl -n "${NAMESPACE}" exec deploy/actcore-worker -- \
tar czf - -C /var/custodian/memory/working . 2>/dev/null \
| ssh -i "${OPS_SSH_KEY:-$HOME/.ssh/id_ops}" tegwick@92.205.62.239 \
"mkdir -p '${CLONE_DIR}' && tar xzf - -C '${CLONE_DIR}'"
echo "=== Destination file count ==="
ssh -i "${OPS_SSH_KEY:-$HOME/.ssh/id_ops}" tegwick@92.205.62.239 \
"ls -1 '${CLONE_DIR}'/daily-triage-*.md 2>/dev/null | wc -l"
echo "Done. Run consistency sweep on the-custodian to commit migrated notes."