[Unit] Description=MemPalace backup (cold — quiesces the server for a byte-consistent copy) Documentation=file:%h/mempalace-toolkit/docs/backup-and-recovery.md ConditionPathExists=%h/.mempalace/palace [Service] Type=oneshot # Cold mode stops mempalace-serve, copies the palace at rest (so the HNSW index # is byte-consistent with the SQLite, not merely repairable from it), and starts # it again. The restart is trapped on EXIT/INT/TERM inside the script, so an # interrupted or failed run still brings the server back up. # # Measured downtime on a 223 MB palace: ~5 seconds. # # NOTE: mempalace-serve.service ships a drop-in with Restart=always. That is # correct for crash recovery but means an explicit `systemctl --user stop` is the # only way to keep it down for the duration of the copy — do not expect a plain # SIGTERM to hold it. ExecStart=%h/.local/bin/mempalace-backup --cold --keep 7 Nice=10