quill: add profile backup/restore SOP and verifier

This commit is contained in:
quill committed 2026-10-26 11:15:01 +00:00
1 parent cd972a99af
commit 6fdb6838d7
2 files changed
+72

No files matched your search

@@ -0,0 +1,47 @@
# Hermes Profile Backup & Restore SOP
> Draft by Quill — verifiable, no stub steps.
## Scope
Portable backup and restore of a single Hermes profile using filesystem operations only. Target: `/root/.hermes/profiles/quill/`.
## Prereqs
- The profile directory exists.
- `tar` and `gzip` are available (present on this host: verified via `command -v tar` and `command -v gzip`).
## Steps
### 1. Create backup archive
```bash
PROFILE_DIR="/root/.hermes/profiles/quill"
BACKUP_DIR="/root/.hermes/wizard-outputs/quill/backups"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
ARCHIVE="$BACKUP_DIR/quill-profile-$TIMESTAMP.tar.gz"
mkdir -p "$BACKUP_DIR"
tar -czf "$ARCHIVE" -C "$(dirname "$PROFILE_DIR")" "$(basename "$PROFILE_DIR")"
```
Success: archive file exists and is non-empty. Measured: `$ARCHIVE` size > 0.
### 2. Verify archive integrity
```bash
tar -tzf "$ARCHIVE" > /dev/null
```
Success: exit code 0. Measured: `$?` == 0.
### 3. Restore from archive
```bash
RESTORE_TARGET="/tmp/quill-profile-restore-test"
rm -rf "$RESTORE_TARGET"
mkdir -p "$RESTORE_TARGET"
tar -xzf "$ARCHIVE" -C "$RESTORE_TARGET"
```
Success: restored directory exists. Measured: `[ -d "$RESTORE_TARGET/quill" ]`.
### 4. Verify restored content
```bash
diff -r "/root/.hermes/profiles/quill" "$RESTORE_TARGET/quill"
```
Success: no differences (exit code 0). Measured: `$?` == 0.
## Verification
A working backup/restore produces an archive with identical contents to the live profile.
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail
PROFILE_DIR="/root/.hermes/profiles/quill"
BACKUP_DIR="/root/.hermes/wizard-outputs/quill/backups"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
ARCHIVE="$BACKUP_DIR/quill-profile-$TIMESTAMP.tar.gz"
RESTORE_TARGET="/tmp/quill-profile-restore-test"
# Step 1: create archive
mkdir -p "$BACKUP_DIR"
tar -czf "$ARCHIVE" -C "$(dirname "$PROFILE_DIR")" "$(basename "$PROFILE_DIR")"
# Step 2: verify archive integrity
tar -tzf "$ARCHIVE" > /dev/null
# Step 3: restore
rm -rf "$RESTORE_TARGET"
mkdir -p "$RESTORE_TARGET"
tar -xzf "$ARCHIVE" -C "$RESTORE_TARGET"
# Step 4: verify restored content matches live profile
diff -r "$PROFILE_DIR" "$RESTORE_TARGET/quill" > /dev/null
echo "OK archive=$ARCHIVE restored=$RESTORE_TARGET/quill"