Automate off-host backup of SQLite + per-tenant note files #41
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add automated, off-host backup for librenotes state on netcup. Currently
/srv/librenotes/data/(per-tenant note files) and/srv/librenotes/state/(librenotes.dbSQLite) are bind-mounted volumes with no backup; a host failure or accidentaldocker compose down -vwould lose all user data.Context
sqlite3 .dump(orsqlite3 .backup) yields a consistent snapshot without locking writers./srv/librenotes/data/<tenant-uuid>/..., sorsync -a --link-destfor incrementals is sufficient.Tasks
scripts/backup.sh(in this repo or inlibretech/netcup) that:sqlite3 /srv/librenotes/state/librenotes.db ".backup /tmp/librenotes-$(date +%F).db", gzips, ships to off-host target/srv/librenotes/data/to a dated directory at the target--link-destagainst the previous day for cheap incrementalsdocs/self-hosting.md(or newdocs/backup.md)Acceptance Criteria
Dependencies