Specify restic repository in the environment variable

This commit is contained in:
Ivan R. 2024-11-25 14:31:08 +05:00
parent d840efa1e0
commit e558ab6609
Signed by: lumin
GPG key ID: E0937DC7CD6D3817
2 changed files with 4 additions and 3 deletions

View file

@ -15,6 +15,7 @@
AWS_ACCESS_KEY_ID: "{{ s3_access_key_id }}"
AWS_SECRET_ACCESS_KEY: "{{ s3_secret_access_key }}"
AWS_DEFAULT_REGION: "{{ s3_region }}"
RESTIC_REPOSITORY: s3:https://{{ s3_host }}/{{ s3_bucket }}
RESTIC_PASSWORD: "{{ restic_password }}"
networks:
- name: postgresql

View file

@ -2,8 +2,8 @@
set -e
docker exec restic-1 restic --repo s3:https://{{ s3_host }}/{{ s3_bucket }} -o s3.bucket-lookup=dns \
docker exec restic-1 restic -o s3.bucket-lookup=dns \
backup --stdin-filename /data/postgresql.sql --stdin-from-command \
-- pg_dumpall -U postgres -h postgresql --no-password
docker exec restic-1 restic --repo s3:https://{{ s3_host }}/{{ s3_bucket }} -o s3.bucket-lookup=dns backup /data/immich
docker exec restic-1 restic --repo s3:https://{{ s3_host }}/{{ s3_bucket }} -o s3.bucket-lookup=dns forget --keep-daily 7 --keep-weekly 2
docker exec restic-1 restic -o s3.bucket-lookup=dns backup /data/immich
docker exec restic-1 restic -o s3.bucket-lookup=dns forget --keep-daily 7 --keep-weekly 2