Put Nextcloud in maintenance mode during backups

This commit is contained in:
Sam A. 2023-09-23 21:09:54 +02:00
parent eb8db1725b
commit 7304bb18f5
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
2 changed files with 7 additions and 2 deletions

View file

@ -60,7 +60,8 @@ services:
sender_domains: sender_domains:
- "{{ services.nextcloud.domain }}" - "{{ services.nextcloud.domain }}"
backup_volumes: restic_volumes:
- "/var/run/docker.sock:/var/run/docker.sock:rw"
- "{{ services.caddy.volume }}:/mnt/volumes/caddy:ro" - "{{ services.caddy.volume }}:/mnt/volumes/caddy:ro"
- "{{ services.postfix.volume }}:/mnt/volumes/postfix:ro" - "{{ services.postfix.volume }}:/mnt/volumes/postfix:ro"
- "{{ services.emby.volume }}:/mnt/volumes/emby:ro" - "{{ services.emby.volume }}:/mnt/volumes/emby:ro"

View file

@ -29,10 +29,14 @@
--keep-daily 7 --keep-daily 7
--keep-weekly 5 --keep-weekly 5
--keep-monthly 12 --keep-monthly 12
PRE_COMMANDS: |-
docker exec -u www-data nextcloud_app_1 php occ maintenance:mode --on
POST_COMMANDS_EXIT: |-
docker exec -u www-data nextcloud_app_1 php occ maintenance:mode --off
B2_ACCOUNT_ID: "{{ secrets.restic.b2.id }}" B2_ACCOUNT_ID: "{{ secrets.restic.b2.id }}"
B2_ACCOUNT_KEY: "{{ secrets.restic.b2.key }}" B2_ACCOUNT_KEY: "{{ secrets.restic.b2.key }}"
TZ: "{{ timezone }}" TZ: "{{ timezone }}"
volumes: "{{ backup_volumes }}" volumes: "{{ restic_volumes }}"
prune: prune:
image: mazzolino/restic:{{ services.restic.version }} image: mazzolino/restic:{{ services.restic.version }}