vps/roles/stump/tasks/backup.yml
2024-04-20 12:48:37 +02:00

30 lines
875 B
YAML

- name:
become: true
block:
- name: Backup SQLite database
command:
cmd: |
sqlite3
"{{ volumes['stump_configdir'] }}/stump.db"
".backup {{ volumes['stump_configdir'] }}/stump-backup.db"
- name: Create borg backup
command:
cmd: |
borg create
--compression=lzma
"{{ borg_repodir }}::{{ role_name }}-{now:%Y-%m-%d_%H-%M-%S}"
{{ volumes['stump_configdir'] }}/stump-backup.db
{{ volumes['stump_datadir'] }}
environment:
BORG_PASSCOMMAND: "cat {{ borg_passphrase_file }}"
- name: Prune borg repository
command:
cmd: |
borg prune
--glob-archives='{{ role_name }}-*'
{{ borg_prune_options }}
{{ borg_repodir }}
environment:
BORG_PASSCOMMAND: "cat {{ borg_passphrase_file }}"