1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_restic.git synced 2024-12-11 23:41:32 +01:00

add prune option

This commit is contained in:
Matthias Leutenegger 2019-09-11 16:06:18 +02:00
parent 6b4dcdb5ae
commit 6fd05902e2
2 changed files with 24 additions and 23 deletions

View file

@ -110,28 +110,29 @@ Repository defined in `restic_repos`.
Available variables: Available variables:
| Name | Required (Default) | Description | | Name | Required (Default) | Description |
| ------------------ |:-----------------------------:| ----------------------------------------------------------------------------------------------------------------------- | | ------------------ |:-----------------------------:| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | yes | The name of this backup. Used together with pruning and scheduling and needs to be unique. | | `name` | yes | The name of this backup. Used together with pruning and scheduling and needs to be unique. |
| `repo` | yes | The name of the repository to backup to. | | `repo` | yes | The name of the repository to backup to. |
| `src` | yes | The source directory or file | | `src` | yes | The source directory or file |
| `stdin` | no | Is this backup created from a [stdin](https://restic.readthedocs.io/en/stable/040_backup.html#reading-data-from-stdin)? | | `stdin` | no | Is this backup created from a [stdin](https://restic.readthedocs.io/en/stable/040_backup.html#reading-data-from-stdin)? |
| `stdin_cmd` | no (yes if `stdin` == `true`) | The command to produce the stdin. | | `stdin_cmd` | no (yes if `stdin` == `true`) | The command to produce the stdin. |
| `stdin_filename` | no | The filename used in the repository. | | `stdin_filename` | no | The filename used in the repository. |
| `tags` | no | Array of default tags | | `tags` | no | Array of default tags |
| `keep_last` | no | If set, only keeps the last n snapshots. | | `keep_last` | no | If set, only keeps the last n snapshots. |
| `keep_hourly` | no | If set, only keeps the last n hourly snapshots. | | `keep_hourly` | no | If set, only keeps the last n hourly snapshots. |
| `keep_daily` | no | If set, only keeps the last n daily snapshots. | | `keep_daily` | no | If set, only keeps the last n daily snapshots. |
| `keep_weekly ` | no | If set, only keeps the last n weekly snapshots. | | `keep_weekly ` | no | If set, only keeps the last n weekly snapshots. |
| `keep_monthly` | no | If set, only keeps the last n monthly snapshots. | | `keep_monthly` | no | If set, only keeps the last n monthly snapshots. |
| `keep_yearly ` | no | If set, only keeps the last n yearly snapshots. | | `keep_yearly ` | no | If set, only keeps the last n yearly snapshots. |
| `keep_within` | no | If set, only keeps snapshots in this time period. | | `keep_within` | no | If set, only keeps snapshots in this time period. |
| `keep_tag` | no | If set, keep snapshots with this tags. Make sure to specify a list. | | `keep_tag` | no | If set, keep snapshots with this tags. Make sure to specify a list. |
| `scheduled` | no (`false`) | If `restic_create_cron` is set to `true`, this backup is scheduled. | | `prune` | no (`false`) | If `true`, the `restic forget` command in the script has the [`--prune` option](https://restic.readthedocs.io/en/stable/060_forget.html#removing-backup-snapshots) appended. |
| `schedule_minute` | no (`*`) | Minute when the job is run. ( 0-59, *, */2, etc ) | | `scheduled` | no (`false`) | If `restic_create_cron` is set to `true`, this backup is scheduled. |
| `schedule_hour` | no (`*`) | Hour when the job is run. ( 0-23, *, */2, etc ) | | `schedule_minute` | no (`*`) | Minute when the job is run. ( 0-59, *, */2, etc ) |
| `schedule_weekday` | no (`*`) | Weekday when the job is run. ( 0-6 for Sunday-Saturday, *, etc ) | | `schedule_hour` | no (`*`) | Hour when the job is run. ( 0-23, *, */2, etc ) |
| `schedule_month` | no (`*`) | Month when the job is run. ( 1-12, *, */2, etc ) | | `schedule_weekday` | no (`*`) | Weekday when the job is run. ( 0-6 for Sunday-Saturday, *, etc ) |
| `schedule_month` | no (`*`) | Month when the job is run. ( 1-12, *, */2, etc ) |
## Dependencies ## Dependencies
none none

View file

@ -68,4 +68,4 @@ fi
{# {#
Define stdin forget commands Define stdin forget commands
#} #}
{{ restic_install_path }}/restic forget --path {{ path(item) }} {{ retention_pattern(item) }} {{ restic_install_path }}/restic forget --path {{ path(item) }} {{ retention_pattern(item) }} {% if item.prune is defined and item.prune == true %}--prune{% endif %}