Initial commit

This commit is contained in:
Никита Сычев
2026-01-03 23:09:01 +01:00
commit d0cb02102e
14 changed files with 389 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
ARG BASE_REPO="repo.nstart.local/"
FROM ${BASE_REPO}library/alpine:3.22.1
LABEL org.opencontainers.image.title="VaultWarden backup" \
org.opencontainers.image.description="Supercronic VaultWarden backup."
RUN apk add --no-cache supercronic tar
COPY --chmod=0755 backup.sh /usr/local/bin/backup.sh
COPY --chmod=0644 crontab /etc/supercronic/crontab
CMD ["/usr/bin/supercronic", "/etc/supercronic/crontab"]
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
set -euo pipefail
find /backup -type f -name 'vaultwarden-*.tar.gz' -mtime +30 -print -delete
TIMESTAMP=$(date +'%Y%m%d_%H%M')
DEST="/backup/vaultwarden-${TIMESTAMP}.tar.gz"
tar czf "$DEST" -C /data .
echo "[backup] Created $DEST"
+2
View File
@@ -0,0 +1,2 @@
# Ежедневный запуск в 03:00
0 3 * * * /usr/local/bin/backup.sh >> /var/log/cron.log 2>&1