Add restic backup

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
Bensuperpc 2024-05-18 18:07:56 +02:00
parent 29e3988bca
commit a141daff08
No known key found for this signature in database
GPG Key ID: 15D0B1525584D383
5 changed files with 25 additions and 24 deletions

View File

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

View File

@ -1,7 +1,7 @@
services:
# Backup
backup:
image: offen/docker-volume-backup:latest
image: mazzolino/restic:latest
container_name: backup
profiles:
- backup
@ -9,20 +9,19 @@ services:
env_file:
- env/backup.env
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- backup:/archive
- caddy_data:/backup/caddy_data:ro
- caddy_config:/backup/caddy_config:ro
# - gitea_data:/backup/gitea_data:ro
# - gitea_config:/backup/gitea_config:ro
# - wordpress_db:/backup/wordpress_db:ro
# - wordpress:/backup/wordpress:ro
# - jellyfin_config:/backup/jellyfin_config:ro
# - jellyfin_data:/backup/jellyfin_data:ro
# - jellyfin_cache:/backup/jellyfin_cache:ro
# - qbittorrent_config:/backup/qbittorrent_config:ro
# - qbittorrent_data:/backup/qbittorrent_data:ro
# - uptimekuma_data:/backup/uptimekuma_data:ro
- backup:/mnt/restic
- caddy_data:/data/caddy_data:ro
# - caddy_config:/data/caddy_config:ro
# - gitea_data:/data/gitea_data:ro
# - gitea_config:/data/gitea_config:ro
# - wordpress_db:/data/wordpress_db:ro
# - wordpress:/data/wordpress:ro
# - jellyfin_config:/data/jellyfin_config:ro
# - jellyfin_data:/data/jellyfin_data:ro
# - jellyfin_cache:/data/jellyfin_cache:ro
# - qbittorrent_config:/data/qbittorrent_config:ro
# - qbittorrent_data:/data/qbittorrent_data:ro
# - uptimekuma_data:/data/uptimekuma_data:ro
networks:
- infra-network
security_opt:

View File

@ -1,5 +1,3 @@
version: '3.9'
networks:
infra-network:
driver: bridge

View File

@ -1,5 +1,3 @@
version: '3.9'
volumes:
uptimekuma_data:
name: uptimekuma_data

12
env/backup.env vendored
View File

@ -1,4 +1,8 @@
BACKUP_COMPRESSION="zst"
BACKUP_CRON_EXPRESSION="0 2 * * *"
# BACKUP_RETENTION_DAYS: '7'
# BACKUP_FILENAME="backup-%Y-%m-%dT%H-%M-%S.{{ .Extension }}"
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%