]> git.giacomolli.uk - onechat/commit
Back up the daemon and restore its data
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Tue, 10 Nov 2026 03:51:26 +0000 (00:51 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Tue, 10 Nov 2026 04:11:28 +0000 (01:11 -0300)
commit6844f8c992ec4e276a3a0d93b544de0127eebbd2
treebdb2631ad3e73cabad761fe9a3cc0ce0359c4248
parent3bf0f670487e571a0525844a6c00de495b8a465a
Back up the daemon and restore its data

The backup command asks the running daemon for an archive. A flushed
memory snapshot holds the write locks during the agent copy, and SQLite
VACUUM INTO saves the WhatsApp session without raw database files.
Compression runs after the write locks are released.

Restore validates the archive in a staging directory before it installs
the files. The token lock excludes a running daemon, and a nonempty
destination fails without replacement of its data.
12 files changed:
backup.go [new file with mode: 0644]
backup_archive.go
backup_archive_helper_test.go [new file with mode: 0644]
backup_archive_test.go
backup_test.go [new file with mode: 0644]
daemon.go
main.go
memory.go
socket.go
subagent.go
subagent_run.go
whatsapp.go