2024-04-04 20:26:59 +02:00
|
|
|
- name: "Backup PostgreSQL hedgedoc database & {{ volumes['hedgedoc_uploadsdir'] }} directory"
|
|
|
|
shell: >
|
|
|
|
docker exec postgres
|
|
|
|
pg_dump -c {{ role_name }} |
|
|
|
|
borg create
|
|
|
|
--compression lzma
|
|
|
|
"{{ borg_repodir }}::{{ role_name }}-{now:%Y-%m-%d_%H-%M-%S}"
|
|
|
|
"{{ volumes['hedgedoc_uploadsdir'] }}"
|
|
|
|
-
|
|
|
|
--stdin-name dump_{{ role_name }}.sql
|
2024-03-05 11:15:10 +01:00
|
|
|
environment:
|
2024-04-04 20:26:59 +02:00
|
|
|
DOCKER_HOST: "{{ docker_host }}"
|
2024-03-05 11:15:10 +01:00
|
|
|
BORG_PASSCOMMAND: "cat {{ borg_passphrase_file }}"
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Prune borg repository
|
|
|
|
command:
|
|
|
|
cmd: |
|
|
|
|
borg prune
|
|
|
|
--glob-archives='{{ role_name }}-*'
|
|
|
|
{{ borg_prune_options }}
|
|
|
|
{{ borg_repodir }}
|
|
|
|
environment:
|
|
|
|
BORG_PASSCOMMAND: "cat {{ borg_passphrase_file }}"
|
|
|
|
become: true
|