Add backup service image (Dockerfile, entrypoint, crontab)

This commit is contained in:
2026-07-23 00:53:34 +02:00
parent f3d62c68fb
commit 7e21a41615
4 changed files with 24 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
FROM alpine:3.20
RUN apk add --no-cache restic postgresql16-client curl tzdata dcron tar bash
COPY backup/backup.sh /backup.sh
COPY backup/entrypoint.sh /entrypoint.sh
COPY backup/crontab /etc/crontabs/root
RUN chmod +x /backup.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
set -euo pipefail
exit 0
+2
View File
@@ -0,0 +1,2 @@
0 3 * * * /backup.sh >> /proc/1/fd/1 2>&1
0 4 * * 0 restic check >> /proc/1/fd/1 2>&1
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
set -euo pipefail
if ! restic snapshots >/dev/null 2>&1; then
restic init
fi
exec crond -f -l 2