diff --git a/roles/backups/tasks/main.yml b/roles/backups/tasks/main.yml index bfde0bb..84382ed 100644 --- a/roles/backups/tasks/main.yml +++ b/roles/backups/tasks/main.yml @@ -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 diff --git a/roles/backups/templates/backup.sh.j2 b/roles/backups/templates/backup.sh.j2 index 9ff724a..7991d0f 100644 --- a/roles/backups/templates/backup.sh.j2 +++ b/roles/backups/templates/backup.sh.j2 @@ -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