add forget_args var

This commit is contained in:
Jake Walker 2025-08-12 18:01:51 +01:00
parent b69c807b82
commit 4c9e3b1830
No known key found for this signature in database
3 changed files with 12 additions and 14 deletions

View file

@ -31,8 +31,8 @@ Each folder has a `path` and an `exclude` property (which defaults to nothing).
Each database has a `name` property which will be the name of the restic snapshot (`{{ database.name }}.sql`). They also have a `dump_command` property which is the command to dump the database to stdout (like `mysqldump dbname`). Each database has a `name` property which will be the name of the restic snapshot (`{{ database.name }}.sql`). They also have a `dump_command` property which is the command to dump the database to stdout (like `mysqldump dbname`).
- `restic_forget`: run `restic forget` as `ExecStartPost` with `--keep-within {{ restic_forget_keep_within }}` (`true`) - `restic_forget`: run `restic forget` as `ExecStartPost` (`true`)
- `restic_forget_keep_within`: period of time to use with `--keep-within` (`30d`) - `restic_forget_args`: period of time to keep backups for. args passed to `restic forget` if `restic_forget` is enabled (`--keep-within 30d`)
- `restic_prune`: run `restic prune` as `ExecStartPost` (`true`) - `restic_prune`: run `restic prune` as `ExecStartPost` (`true`)
### SSH/SFTP backend configuration ### SSH/SFTP backend configuration
@ -70,7 +70,6 @@ You can see the logs of the backup with `journalctl`. (`journalctl -xefu restic-
```yaml ```yaml
--- ---
- hosts: myhost - hosts: myhost
roles: restic roles: restic
vars: vars:
@ -97,7 +96,6 @@ S3 example:
```yaml ```yaml
--- ---
- hosts: myhost - hosts: myhost
roles: restic roles: restic
vars: vars:

View file

@ -14,7 +14,7 @@ restic_folders: []
restic_databases: [] restic_databases: []
restic_dump_compression_enabled: false restic_dump_compression_enabled: false
restic_forget: true restic_forget: true
restic_forget_keep_within: 30d restic_forget_args: "--keey-within 30d"
restic_prune: true restic_prune: true
restic_check: true restic_check: true

View file

@ -34,7 +34,7 @@ ExecStart=/bin/sh -c "{{ database.dump_command }} {{ '| pigz |' if restic_dump_c
{% endfor -%} {% endfor -%}
{% if restic_forget %} {% if restic_forget %}
ExecStartPost={{ restic_path }} forget --keep-within {{ restic_forget_keep_within }} ExecStartPost={{ restic_path }} forget {{ restic_forget_args }}
{% endif -%} {% endif -%}
{% if restic_prune %} {% if restic_prune %}