From e552750f66bad1392e9c098275a61cd174e17532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20T=C3=A2che?= Date: Sat, 15 Nov 2025 08:56:05 +0100 Subject: [PATCH] Adds immich, puts redis/database on NVME, uses postgres for wallabag and nextcloud, adds backup services --- files/backup-postgres.sh | 13 +++++++++++++ home/nextcloud/.secrets | 2 -- home/wallabag/.secrets | 1 - init/enable-all-quadlets.sh | 18 ++++++++++++------ pi4.bu | 4 ++++ quadlets/gitea/gitea-database.container | 1 + quadlets/gitea/gitea-database.volume | 5 ----- quadlets/immich/immich-database.container | 5 +++-- quadlets/immich/immich-database.volume | 5 ----- quadlets/immich/immich-ml-cache.volume | 5 ----- quadlets/immich/immich.container | 2 +- .../nextcloud/nextcloud-database.container | 16 ++++++++++------ quadlets/nextcloud/nextcloud-database.volume | 5 ----- quadlets/nextcloud/nextcloud-redis-data.volume | 5 ----- .../paperless/paperless-database.container | 5 +++++ quadlets/paperless/paperless-database.volume | 5 ----- quadlets/paperless/paperless-redis-data.volume | 5 ----- quadlets/pihole/unbound-redis-cache.volume | 5 ----- quadlets/pihole/unbound-redis-data.volume | 5 ----- quadlets/synapse/synapse-database.container | 1 + quadlets/synapse/synapse-database.volume | 5 ----- quadlets/wallabag/wallabag-database.container | 11 +++++++---- quadlets/wallabag/wallabag-database.volume | 5 ----- quadlets/wallabag/wallabag.container | 9 +++++---- services/gitea/backup-database.service | 6 ++++++ services/gitea/backup-database.timer | 10 ++++++++++ services/immich/backup-database.service | 6 ++++++ services/immich/backup-database.timer | 10 ++++++++++ services/nextcloud/backup-database.service | 6 ++++++ services/nextcloud/backup-database.timer | 10 ++++++++++ services/paperless/backup-database.service | 6 ++++++ services/paperless/backup-database.timer | 10 ++++++++++ services/synapse/backup-database.service | 6 ++++++ services/synapse/backup-database.timer | 10 ++++++++++ services/wallabag/backup-database.service | 6 ++++++ services/wallabag/backup-database.timer | 10 ++++++++++ 36 files changed, 158 insertions(+), 81 deletions(-) create mode 100644 files/backup-postgres.sh create mode 100644 services/gitea/backup-database.service create mode 100644 services/gitea/backup-database.timer create mode 100644 services/immich/backup-database.service create mode 100644 services/immich/backup-database.timer create mode 100644 services/nextcloud/backup-database.service create mode 100644 services/nextcloud/backup-database.timer create mode 100644 services/paperless/backup-database.service create mode 100644 services/paperless/backup-database.timer create mode 100644 services/synapse/backup-database.service create mode 100644 services/synapse/backup-database.timer create mode 100644 services/wallabag/backup-database.service create mode 100644 services/wallabag/backup-database.timer diff --git a/files/backup-postgres.sh b/files/backup-postgres.sh new file mode 100644 index 0000000..f67b19a --- /dev/null +++ b/files/backup-postgres.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -o errexit -o pipefail -o noclobber -o nounset -o errtrace -o functrace + +user="$(whoami)" +today=$(date +%F) +dir="/backup/${today}" +host_dir="/var/mnt/nas/containers/${user}/storage/database-backup" +mkdir -p "${host_dir}" +if podman container exists "${user}-database"; then + podman exec "${user}-database" pg_dump -U "${user}" -d "${user}" -F d -Z zstd:3 -f "${dir}" +else + echo "${user}-database" not found +fi diff --git a/home/nextcloud/.secrets b/home/nextcloud/.secrets index 956aefc..5c5b459 100644 --- a/home/nextcloud/.secrets +++ b/home/nextcloud/.secrets @@ -1,6 +1,4 @@ database-password=7w6,{R_C=LdZ@9iy -database-root-password=[-B#xMVj~\3X*vC> -database-user=nextcloud nextcloud-admin-password=tcf@fg]%2BL]K*p` nextcloud-admin-user=admin nextcloud-redis-password=AznBSv9lCflXg2z0 diff --git a/home/wallabag/.secrets b/home/wallabag/.secrets index baa08e7..d8f8c65 100644 --- a/home/wallabag/.secrets +++ b/home/wallabag/.secrets @@ -1,2 +1 @@ database-password=YdBYea47YBCpjhL7ped9 -database-root-password=zUMuEkTzOG8CH8VjvLXE diff --git a/init/enable-all-quadlets.sh b/init/enable-all-quadlets.sh index befee5c..147c332 100644 --- a/init/enable-all-quadlets.sh +++ b/init/enable-all-quadlets.sh @@ -4,7 +4,6 @@ set -o errexit -o pipefail -o noclobber -o nounset -o errtrace -o functrace setsebool -P container_use_devices on setsebool -P openvpn_run_unconfined on semanage fcontext -a -t container_file_t "/mnt/nas(/.*)?" -#semanage fcontext -a -t container_file_t "/mnt/nas/containers/.*/storage/.*(/.*)?" restorecon -vR /mnt/nas users=("gitea" "homeassistant" "immich" "jdownloader" "kiwix" "komga" "navidrome" "nextcloud" "nginx" "pairdrop" "paperless" "pihole" "qbittorrent" "synapse" "wallabag") @@ -15,7 +14,7 @@ for user in "${users[@]}"; do sudo -u "${user}" /opt/bin/add-secrets.sh "${secrets_file}" fi systemctl --user -M "${user}@" daemon-reload - systemctl --user -M "${user}@" enable --now "podman-auto-update.timer" || true + systemctl --user -M "${user}@" enable "podman-auto-update.timer" || true systemctl --user -M "${user}@" stop "${user}.service" || true systemctl --user -M "${user}@" start "${user}.service" echo "${user} done" @@ -23,12 +22,19 @@ done systemctl --user -M "arr@" daemon-reload systemctl --user -M "arr@" start "overseerr.service" systemctl --user -M "tga@" daemon-reload -systemctl --user -M "tga@" enable --now "update-dyndns.timer" +systemctl --user -M "tga@" enable "update-dyndns.timer" systemctl --user -M "kiwix@" enable --now "clone-zim-updater.service" -systemctl --user -M "nextcloud@" enable --now "pre-generate-preview.timer" -systemctl --user -M "pihole@" enable --now "update-hints.timer" -systemctl --user -M "pihole@" enable --now "update-root.timer" +systemctl --user -M "nextcloud@" enable "pre-generate-preview.timer" +systemctl --user -M "pihole@" enable "update-hints.timer" +systemctl --user -M "pihole@" enable "update-root.timer" + +systemctl --user -M "gitea@" enable "backup-database.timer" +systemctl --user -M "immich@" enable "backup-database.timer" +systemctl --user -M "nextcloud@" enable "backup-database.timer" +systemctl --user -M "paperless@" enable "backup-database.timer" +systemctl --user -M "synapse@" enable "backup-database.timer" +systemctl --user -M "wallabag@" enable "backup-database.timer" /opt/bin/add-secrets.sh /root/.secrets systemctl daemon-reload diff --git a/pi4.bu b/pi4.bu index 9edebc5..b298d60 100644 --- a/pi4.bu +++ b/pi4.bu @@ -73,6 +73,10 @@ storage: contents: local: files/add-secrets.sh mode: 0755 + - path: /opt/bin/backup-postgres.sh + contents: + local: files/backup-postgres.sh + mode: 0755 - path: /etc/containers/systemd/samba.container contents: local: quadlets/samba/samba.container diff --git a/quadlets/gitea/gitea-database.container b/quadlets/gitea/gitea-database.container index 10c0aee..f61f9cc 100644 --- a/quadlets/gitea/gitea-database.container +++ b/quadlets/gitea/gitea-database.container @@ -17,6 +17,7 @@ Secret=database-password,type=env,target=POSTGRES_PASSWORD StartWithPod=true Timezone=Europe/Zurich Volume=gitea-database.volume:/var/lib/postgresql +Volume=/var/mnt/nas/containers/gitea/storage/database-backup:/backup [Service] Restart=always diff --git a/quadlets/gitea/gitea-database.volume b/quadlets/gitea/gitea-database.volume index ebdb268..51d287e 100644 --- a/quadlets/gitea/gitea-database.volume +++ b/quadlets/gitea/gitea-database.volume @@ -1,7 +1,2 @@ [Volume] -Copy=true -Device=/var/mnt/nas/containers/gitea/storage/database -Driver=local -Options=bind -Type=none VolumeName=gitea-database diff --git a/quadlets/immich/immich-database.container b/quadlets/immich/immich-database.container index e438160..8859bf4 100644 --- a/quadlets/immich/immich-database.container +++ b/quadlets/immich/immich-database.container @@ -5,11 +5,11 @@ Description=Immich database container AutoUpdate=registry ContainerName=immich-database Environment=DB_STORAGE_TYPE=HDD -Environment=POSTGRES_USER=postgres +Environment=POSTGRES_USER=immich Environment=POSTGRES_DB=immich Environment=POSTGRES_INTIDB_ARGS=--data-checksums Environment=TZ=Europe/Zurich -HealthCmd=pg_isready -U postgres +HealthCmd=pg_isready -U immich HealthInterval=30s HealthTimeout=10s HealthRetries=5 @@ -20,6 +20,7 @@ ShmSize=128m StartWithPod=true Timezone=Europe/Zurich Volume=immich-database.volume:/var/lib/postgresql/data +Volume=/var/mnt/nas/containers/immich/storage/database-backup:/backup [Service] Restart=always diff --git a/quadlets/immich/immich-database.volume b/quadlets/immich/immich-database.volume index ee46e23..0e1da3c 100644 --- a/quadlets/immich/immich-database.volume +++ b/quadlets/immich/immich-database.volume @@ -1,7 +1,2 @@ [Volume] -Copy=true -Device=/var/mnt/nas/containers/immich/storage/database -Driver=local -Options=bind -Type=none VolumeName=immich-database diff --git a/quadlets/immich/immich-ml-cache.volume b/quadlets/immich/immich-ml-cache.volume index e2c3e2e..933d715 100644 --- a/quadlets/immich/immich-ml-cache.volume +++ b/quadlets/immich/immich-ml-cache.volume @@ -1,7 +1,2 @@ [Volume] -Copy=true -Device=/var/mnt/nas/containers/immich/storage/ml-cache -Driver=local -Options=bind -Type=none VolumeName=immich-ml-cache diff --git a/quadlets/immich/immich.container b/quadlets/immich/immich.container index a74a87f..1c4c016 100644 --- a/quadlets/immich/immich.container +++ b/quadlets/immich/immich.container @@ -9,7 +9,7 @@ Requires=immich-redis.container AutoUpdate=registry ContainerName=immich Environment=DB_DATA_LOCATION=./postgres -Environment=DB_USERNAME=postgres +Environment=DB_USERNAME=immich Environment=DB_DATABASE_NAME=immich Environment=IMMICH_VERSION=v2 Environment=TZ=Europe/Zurich diff --git a/quadlets/nextcloud/nextcloud-database.container b/quadlets/nextcloud/nextcloud-database.container index 0e2bb4f..a02b0ca 100644 --- a/quadlets/nextcloud/nextcloud-database.container +++ b/quadlets/nextcloud/nextcloud-database.container @@ -4,16 +4,20 @@ Description=Nextcloud database container [Container] AutoUpdate=registry ContainerName=nextcloud-database -Environment=MYSQL_DATABASE=nextcloud +Environment=POSTGRES_DB=nextcloud +Environment=POSTGRES_USER=nextcloud Environment=TZ=Europe/Zurich -Image=docker.io/mariadb:latest +HealthCmd=pg_isready -U nextcloud +HealthInterval=30s +HealthTimeout=10s +HealthRetries=5 +Image=docker.io/postgres:18 Pod=nextcloud.pod -Secret=database-user,type=env,target=MYSQL_USER -Secret=database-password,type=env,target=MYSQL_PASSWORD -Secret=database-root-password,type=env,target=MYSQL_ROOT_PASSWORD +Secret=database-password,type=env,target=POSTGRES_PASSWORD StartWithPod=true Timezone=Europe/Zurich -Volume=nextcloud-database.volume:/var/lib/mysql +Volume=nextcloud-database.volume:/var/lib/postgresql +Volume=/var/mnt/nas/containers/nextcloud/storage/database-backup:/backup [Service] Restart=always diff --git a/quadlets/nextcloud/nextcloud-database.volume b/quadlets/nextcloud/nextcloud-database.volume index a746703..63ebefc 100644 --- a/quadlets/nextcloud/nextcloud-database.volume +++ b/quadlets/nextcloud/nextcloud-database.volume @@ -1,7 +1,2 @@ [Volume] -Copy=true -Device=/var/mnt/nas/containers/nextcloud/storage/database -Driver=local -Options=bind -Type=none VolumeName=nextcloud-database diff --git a/quadlets/nextcloud/nextcloud-redis-data.volume b/quadlets/nextcloud/nextcloud-redis-data.volume index b8a3691..70577e2 100644 --- a/quadlets/nextcloud/nextcloud-redis-data.volume +++ b/quadlets/nextcloud/nextcloud-redis-data.volume @@ -1,7 +1,2 @@ [Volume] -Copy=true -Device=/var/mnt/nas/containers/nextcloud/storage/redis-data -Driver=local -Options=bind -Type=none VolumeName=nextcloud-redis-data diff --git a/quadlets/paperless/paperless-database.container b/quadlets/paperless/paperless-database.container index ca8551d..d88ed76 100644 --- a/quadlets/paperless/paperless-database.container +++ b/quadlets/paperless/paperless-database.container @@ -7,12 +7,17 @@ ContainerName=paperless-database Environment=POSTGRES_USER=paperless Environment=POSTGRES_DB=paperless Environment=TZ=Europe/Zurich +HealthCmd=pg_isready -U paperless +HealthInterval=30s +HealthTimeout=10s +HealthRetries=5 Image=docker.io/library/postgres:18 Pod=paperless.pod Secret=database-password,type=env,target=POSTGRES_PASSWORD StartWithPod=true Timezone=Europe/Zurich Volume=paperless-database.volume:/var/lib/postgresql +Volume=/var/mnt/nas/containers/paperless/storage/database-backup:/backup [Service] Restart=always diff --git a/quadlets/paperless/paperless-database.volume b/quadlets/paperless/paperless-database.volume index 8478a30..1fa4ca0 100644 --- a/quadlets/paperless/paperless-database.volume +++ b/quadlets/paperless/paperless-database.volume @@ -1,7 +1,2 @@ [Volume] -Copy=true -Device=/var/mnt/nas/containers/paperless/storage/database -Driver=local -Options=bind -Type=none VolumeName=paperless-database diff --git a/quadlets/paperless/paperless-redis-data.volume b/quadlets/paperless/paperless-redis-data.volume index 3b1bad1..435ff26 100644 --- a/quadlets/paperless/paperless-redis-data.volume +++ b/quadlets/paperless/paperless-redis-data.volume @@ -1,7 +1,2 @@ [Volume] -Copy=true -Device=/var/mnt/nas/containers/paperless/storage/redis-data -Driver=local -Options=bind -Type=none VolumeName=paperless-redis-data diff --git a/quadlets/pihole/unbound-redis-cache.volume b/quadlets/pihole/unbound-redis-cache.volume index 5c703fe..8f796c1 100644 --- a/quadlets/pihole/unbound-redis-cache.volume +++ b/quadlets/pihole/unbound-redis-cache.volume @@ -1,7 +1,2 @@ [Volume] -Copy=true -Device=/var/mnt/nas/containers/pihole/storage/unbound-redis-cache -Driver=local -Options=bind -Type=none VolumeName=unbound-redis-cache diff --git a/quadlets/pihole/unbound-redis-data.volume b/quadlets/pihole/unbound-redis-data.volume index bc46785..f6604b5 100644 --- a/quadlets/pihole/unbound-redis-data.volume +++ b/quadlets/pihole/unbound-redis-data.volume @@ -1,7 +1,2 @@ [Volume] -Copy=true -Device=/var/mnt/nas/containers/pihole/storage/unbound-redis-data -Driver=local -Options=bind -Type=none VolumeName=unbound-redis-data diff --git a/quadlets/synapse/synapse-database.container b/quadlets/synapse/synapse-database.container index 64e42ec..418a66b 100644 --- a/quadlets/synapse/synapse-database.container +++ b/quadlets/synapse/synapse-database.container @@ -18,6 +18,7 @@ Secret=database-password,type=env,target=POSTGRES_PASSWORD StartWithPod=true Timezone=Europe/Zurich Volume=synapse-database.volume:/var/lib/postgresql +Volume=/var/mnt/nas/containers/synapse/storage/database-backup:/backup [Service] Restart=always diff --git a/quadlets/synapse/synapse-database.volume b/quadlets/synapse/synapse-database.volume index 8021770..49411cf 100644 --- a/quadlets/synapse/synapse-database.volume +++ b/quadlets/synapse/synapse-database.volume @@ -1,7 +1,2 @@ [Volume] -Copy=true -Device=/var/mnt/nas/containers/synapse/storage/database -Driver=local -Options=bind -Type=none VolumeName=synapse-database diff --git a/quadlets/wallabag/wallabag-database.container b/quadlets/wallabag/wallabag-database.container index 95cb034..223db8c 100644 --- a/quadlets/wallabag/wallabag-database.container +++ b/quadlets/wallabag/wallabag-database.container @@ -4,17 +4,20 @@ Description=Wallabag database container [Container] AutoUpdate=registry ContainerName=wallabag-database +Environment=POSTGRES_DB=wallabag +Environment=POSTGRES_USER=wallabag Environment=TZ=Europe/Zurich -HealthCmd=CMD mysqladmin ping -h localhost +HealthCmd=pg_isready -U wallabag HealthInterval=30s HealthTimeout=10s HealthRetries=5 -Image=docker.io/mariadb:latest +Image=docker.io/postgres:18 Pod=wallabag.pod -Secret=database-root-password,type=env,target=MYSQL_ROOT_PASSWORD +Secret=database-password,type=env,target=POSTGRES_PASSWORD StartWithPod=true Timezone=Europe/Zurich -Volume=wallabag-database.volume:/var/lib/mysql +Volume=wallabag-database.volume:/var/lib/postgresql +Volume=/var/mnt/nas/containers/wallabag/storage/database-backup:/backup [Service] Restart=always diff --git a/quadlets/wallabag/wallabag-database.volume b/quadlets/wallabag/wallabag-database.volume index 09e0dbf..d9af463 100644 --- a/quadlets/wallabag/wallabag-database.volume +++ b/quadlets/wallabag/wallabag-database.volume @@ -1,7 +1,2 @@ [Volume] -Copy=true -Device=/var/mnt/nas/containers/wallabag/storage/database -Driver=local -Options=bind -Type=none VolumeName=wallabag-database diff --git a/quadlets/wallabag/wallabag.container b/quadlets/wallabag/wallabag.container index f68f308..a2e65d1 100644 --- a/quadlets/wallabag/wallabag.container +++ b/quadlets/wallabag/wallabag.container @@ -8,12 +8,13 @@ Requires=wallabag-redis.container [Container] AutoUpdate=registry ContainerName=wallabag -Environment=SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql +Environment=POSTGRES_DB=wallabag +Environment=POSTGRES_USER=wallabag +Environment=SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql Environment=SYMFONY__ENV__DATABASE_HOST=wallabag-database -Environment=SYMFONY__ENV__DATABASE_PORT=3306 +Environment=SYMFONY__ENV__DATABASE_PORT=5432 Environment=SYMFONY__ENV__DATABASE_NAME=wallabag Environment=SYMFONY__ENV__DATABASE_USER=wallabag -Environment=SYMFONY__ENV__DATABASE_CHARSET=utf8mb4 Environment=SYMFONY__ENV__DATABASE_TABLE_PREFIX=wallabag_ Environment=SYMFONY__ENV__MAILER_DSN=smtp:127.0.0.1 Environment=SYMFONY__ENV__FROM_EMAIL=wallabag@gtache.ch @@ -26,7 +27,7 @@ HealthTimeout=5s HealthRetries=5 Image=docker.io/wallabag/wallabag:latest Pod=wallabag.pod -Secret=database-root-password,type=env,target=MYSQL_ROOT_PASSWORD +Secret=database-password,type=env,target=POSTGRES_PASSWORD Secret=database-password,type=env,target=SYMFONY__ENV__DATABASE_PASSWORD StartWithPod=true Timezone=Europe/Zurich diff --git a/services/gitea/backup-database.service b/services/gitea/backup-database.service new file mode 100644 index 0000000..7cae1e2 --- /dev/null +++ b/services/gitea/backup-database.service @@ -0,0 +1,6 @@ +[Unit] +Description=Backups the Gitea database + +[Service] +Type=oneshot +ExecStart=/opt/bin/backup-postgres.sh diff --git a/services/gitea/backup-database.timer b/services/gitea/backup-database.timer new file mode 100644 index 0000000..26fa63b --- /dev/null +++ b/services/gitea/backup-database.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Timer for the backup-database service + +[Timer] +OnCalendar=12:00:00 +Persistent=true +Unit=backup-database.service + +[Install] +WantedBy=timers.target diff --git a/services/immich/backup-database.service b/services/immich/backup-database.service new file mode 100644 index 0000000..81f4b1f --- /dev/null +++ b/services/immich/backup-database.service @@ -0,0 +1,6 @@ +[Unit] +Description=Backups the Immich database + +[Service] +Type=oneshot +ExecStart=/opt/bin/backup-database.sh diff --git a/services/immich/backup-database.timer b/services/immich/backup-database.timer new file mode 100644 index 0000000..26fa63b --- /dev/null +++ b/services/immich/backup-database.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Timer for the backup-database service + +[Timer] +OnCalendar=12:00:00 +Persistent=true +Unit=backup-database.service + +[Install] +WantedBy=timers.target diff --git a/services/nextcloud/backup-database.service b/services/nextcloud/backup-database.service new file mode 100644 index 0000000..e6dd3e3 --- /dev/null +++ b/services/nextcloud/backup-database.service @@ -0,0 +1,6 @@ +[Unit] +Description=Backups the Nextcloud database + +[Service] +Type=oneshot +ExecStart=/opt/bin/backup-postgres.sh diff --git a/services/nextcloud/backup-database.timer b/services/nextcloud/backup-database.timer new file mode 100644 index 0000000..26fa63b --- /dev/null +++ b/services/nextcloud/backup-database.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Timer for the backup-database service + +[Timer] +OnCalendar=12:00:00 +Persistent=true +Unit=backup-database.service + +[Install] +WantedBy=timers.target diff --git a/services/paperless/backup-database.service b/services/paperless/backup-database.service new file mode 100644 index 0000000..1f722b0 --- /dev/null +++ b/services/paperless/backup-database.service @@ -0,0 +1,6 @@ +[Unit] +Description=Backups the paperless database + +[Service] +Type=oneshot +ExecStart=/opt/bin/backup-postgres.sh diff --git a/services/paperless/backup-database.timer b/services/paperless/backup-database.timer new file mode 100644 index 0000000..26fa63b --- /dev/null +++ b/services/paperless/backup-database.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Timer for the backup-database service + +[Timer] +OnCalendar=12:00:00 +Persistent=true +Unit=backup-database.service + +[Install] +WantedBy=timers.target diff --git a/services/synapse/backup-database.service b/services/synapse/backup-database.service new file mode 100644 index 0000000..88a0786 --- /dev/null +++ b/services/synapse/backup-database.service @@ -0,0 +1,6 @@ +[Unit] +Description=Backups the Synapse database + +[Service] +Type=oneshot +ExecStart=/opt/bin/backup-postgres.sh diff --git a/services/synapse/backup-database.timer b/services/synapse/backup-database.timer new file mode 100644 index 0000000..26fa63b --- /dev/null +++ b/services/synapse/backup-database.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Timer for the backup-database service + +[Timer] +OnCalendar=12:00:00 +Persistent=true +Unit=backup-database.service + +[Install] +WantedBy=timers.target diff --git a/services/wallabag/backup-database.service b/services/wallabag/backup-database.service new file mode 100644 index 0000000..4d24766 --- /dev/null +++ b/services/wallabag/backup-database.service @@ -0,0 +1,6 @@ +[Unit] +Description=Backups the Wallabag database + +[Service] +Type=oneshot +ExecStart=/opt/bin/backup-postgres.sh diff --git a/services/wallabag/backup-database.timer b/services/wallabag/backup-database.timer new file mode 100644 index 0000000..26fa63b --- /dev/null +++ b/services/wallabag/backup-database.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Timer for the backup-database service + +[Timer] +OnCalendar=12:00:00 +Persistent=true +Unit=backup-database.service + +[Install] +WantedBy=timers.target