WIP autorestic

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
Bensuperpc 2024-05-19 13:40:44 +02:00
parent ced832d359
commit 0e523a9edc
No known key found for this signature in database
GPG Key ID: 15D0B1525584D383
4 changed files with 22 additions and 13 deletions

View File

@ -13,9 +13,11 @@
DOCKER := docker
PROFILES := caddy wordpress adminer backup qbittorrent syncthing gitea gitea-runner uptime-kuma jellyfin watchtower
PROFILES := backup
PROFILE_CMD := $(addprefix --profile ,$(PROFILES))
# caddy syncthing gitea gitea-runner uptime-kuma jellyfin watchtower adminer wordpress qbittorrent
COMPOSE_FILES := $(shell find docker-compose*.yml | sed -e 's/^/--file /')
.PHONY: build all

View File

@ -0,0 +1,13 @@
version: 2
locations:
caddy_data:
from: /data/caddy_data
to:
- foo
cron: '* * * * *'
backends:
foo:
type: local
path: /backup

View File

@ -1,15 +1,18 @@
services:
# Backup
backup:
image: mazzolino/restic:latest
image: cupcakearmy/autorestic:latest
container_name: backup
profiles:
- backup
restart: on-failure:5
env_file:
- env/backup.env
#entrypoint: ["autorestic", "backup", "--ci", "-va", "-c", "/data/autorestic.yml"]
entrypoint: ["restic init --repository-version 2 --repo", "/data/caddy_data"]
volumes:
- backup:/mnt/restic
- backup:/backup
- ./config/backup/autorestic.yml:/data/autorestic.yml:ro
- caddy_data:/data/caddy_data:ro
- caddy_config:/data/caddy_config:ro
# - gitea_data:/data/gitea_data:ro
@ -22,8 +25,6 @@ services:
# - qbittorrent_config:/data/qbittorrent_config:ro
# - qbittorrent_data:/data/qbittorrent_data:ro
# - uptimekuma_data:/data/uptimekuma_data:ro
networks:
- infra-network
security_opt:
- no-new-privileges:true

9
env/backup.env vendored
View File

@ -1,8 +1 @@
BACKUP_CRON=0 2 * * *
RESTIC_REPOSITORY=/mnt/restic
RESTIC_BACKUP_SOURCES=/data
RESTIC_PASSWORD=7L1Ncbquax0B2TCOmrjaQl9n5mnY88bQ
#RESTIC_BACKUP_ARGS=
#RESTIC_FORGET_ARGS=--prune --keep-last 14 --keep-daily 1
#RESTIC_PRUNE_ARGS=
RESTIC_CHECK_ARGS=--read-data-subset=20%
AUTORESTIC_FOO_RESTIC_PASSWORD=secret123