dev / templates / bot / deploy / backup-state.sh
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#!/bin/sh
# Pull the fleet's precious state — the bots' identity seeds and the model
# checkpoints — from the server to a local tarball. Run it from your machine:
#
#   sh deploy/backup-state.sh <ssh-host> [out-dir]
#
# Seeds are secrets: the tarball lands mode 0600, keep it out of any repo.
set -eu
HOST="${1:?usage: backup-state.sh <ssh-host> [out-dir]}"
OUT="${2:-.}/ardegazu-__NAME__-state-$(date +%Y%m%d-%H%M%S).tar.gz"
ssh "$HOST" 'cd /var/lib/ardegazu-__NAME__ 2>/dev/null || cd /var/lib/private/ardegazu-__NAME__; tar czf - */seed models 2>/dev/null' > "$OUT"
chmod 600 "$OUT"
ls -l "$OUT"

static mirror of HEAD · about · clone: git clone https://git.ardegazu.ro/dev.git