fix(k8s/grocy): open SQLite database read-only in backup job
This commit is contained in:
@@ -25,8 +25,10 @@ spec:
|
|||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
|
set -e
|
||||||
apk add --no-cache sqlite
|
apk add --no-cache sqlite
|
||||||
sqlite3 /db-local/grocy.db ".backup /backup/grocy.db"
|
sqlite3 "file:/db-local/grocy.db?mode=ro" ".backup /backup/grocy.db"
|
||||||
|
[ "$(sqlite3 /backup/grocy.db 'PRAGMA integrity_check')" = ok ]
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: db
|
- name: db
|
||||||
mountPath: /db-local
|
mountPath: /db-local
|
||||||
|
|||||||
Reference in New Issue
Block a user