mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-09-21 05:21:43 +00:00
Add backup service image (Dockerfile, entrypoint, crontab)
This commit is contained in:
@@ -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"]
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
exit 0
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user