You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
command:
- /bin/sh
- -c
- apk add sqlite; cd /server; time tar czf /backup/k3s-server-backup-$(date +%F:%R).tgz --exclude *.sock --exclude db . && time sqlite3 db/state.db .dump | gzip -c > /backup/k3s-server-db-dump-$(date +%F:%R).gz && time sqlite3 db/state.db ".backup '/backup/k3s-server-db-backup-$(date +%F:%R).sql" && time find /backup -type f -mtime +60 -delete;
This takes two types of sqlite backup, one a SQL dump, another a DB page by page backup. I am not sure if the drastic decrease in size after restoring the .dump version is actually correct. So, to be on the safer side, I am doing both forms of backups and raised an issue at k3s-io/k3s#5219
To restore,
cd /var/lib/rancher/k3s; mv server server.old; mkdir -p server/db;cd server
tar -xzf k3s-server-backup-XXX.tgz
zcat k3s-server-db-dump-XXX.gz | sqlite3 db/state.db
# OR
cp k3s-server-db-backup-XXX.db db/state.db
The text was updated successfully, but these errors were encountered:
Hey thanks! I was just looking at why my current backups were failing and this came in at the same time. I'm aware that my current approach may backup the DB in a inconsistent state.
For https://github.com/gilesknap/k3s-minecraft/tree/main/useful/deployed/backup-sqlite, I used the following for taking a backup.
This takes two types of sqlite backup, one a SQL dump, another a DB page by page backup. I am not sure if the drastic decrease in size after restoring the .dump version is actually correct. So, to be on the safer side, I am doing both forms of backups and raised an issue at k3s-io/k3s#5219
To restore,
The text was updated successfully, but these errors were encountered: